-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Format string reentrency #2244
Comments
Another related issue: we should allow any code in ${} , not only values. |
Another last issue is that quoted chars in sub format strings are unquoted. |
I think we should first find a better way to communicate the quoted status (" or ') for strings, which would make this a Haxe 4 issue. |
you mean inside the string itself ? this should not be required, given that we have all the information needed to correctly lex it |
This suggests to me that the information is lost somewhere. I'm not very familiar with the current implementation, but in general inner format strings should be handled without any additional effort via normal expression recursion. |
Yes, I agree, this is normally done directly in lexer.mll (string2, code_string) which should unquote things as they should, but doesn't |
Don't we need a stack in order to lex nested structures like this? At the moment we only have |
Eh, I guess we don't because we dump everything into the same buffer and deal with it while typing. |
I fixed the spacing issue. As for this:
I consider that a fair limitation. If you want a block you have to start a block. Sure it looks a bit funny because interpolation also uses
Any example of that? |
|
Related issues:
And here is a new one: class Main {
public static function main():Void {
var foo = "hello";
trace('${'${foo}'}'); // outputs hello
trace('\n${'${foo}'}'); // outputs ${foo}
}
} |
I'm going to revive my old branch with the "mini-ast" and probably do what is suggested in #9370 (comment). |
With b94ee60, it is now possible to have format strings in format strings:
'Hello ${name+'$age years'} old'
However there seems to be an issue if the inner string has spaces around it:
'${ '${x}'}'
does not work (the inner string is not considered a format string)The text was updated successfully, but these errors were encountered: