Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String interpolation parsing may fail if brackets exist inside interpolated expression #2595

Closed
SlugFiller opened this issue Feb 2, 2014 · 4 comments
Assignees
Milestone

Comments

@SlugFiller
Copy link

The following code fails to parse:
trace('${'This' {" should";} ' work'}');
Outputs:
Unexpected work

Tested with http://try.haxe.org, version reported as 3.1.0 1c25e98

@nadako
Copy link
Member

nadako commented Feb 2, 2014

Shouldn't this fail at This? (because the string is closed in '${')

@nadako
Copy link
Member

nadako commented Feb 2, 2014

This should probably parse though:

var a = "This"   {" should";}   " work";

@SlugFiller
Copy link
Author

This is an interpolated string. According to the Haxe manual, anything inside the ${} is taken as an expression, and any expression is allowed. This includes other strings (as well as blocks, functions, loops, etc).

A strange construct, yes, but it's in the docs:
http://haxe.org/manual/string_interpolation

@Simn Simn added this to the 3.2 milestone Feb 15, 2014
@ncannasse
Copy link
Member

See #2244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants