-
Notifications
You must be signed in to change notification settings - Fork 33
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
Escape dots - end of expression #64
Comments
You use ructe for sql? Cool! :-) Ah. The One way of fixing this would be to say that if an expression starts with an open parenthesis, then it ends when that parenthesis is closed. That would make your example behave correctly. And if we just allow the same things inside those parenthesis as we allow in expressions today, I don't see any real down-side. Does that sound ok to you? |
BREAKING CHANGE. If an expession stars with an open parenthesis, the expression ends on the closing parenthesis (and that outer parenthesis is not part of the expression. This fixes cases where an expression is immediately followed by something that could be part of the expression. Before this change, calling a function on the result of some subexpression could be written as `@(a - b).abs()`. After this change, that should be changed to `@((a - b).abs())` unless the intent is to have the result of (a - b) followed by the template string `.abs()`. Fixes #64.
That sounds awesome! 👍 |
BREAKING CHANGE. If an expession starts with an open parenthesis, the expression ends on the closing parenthesis (and that outer parenthesis is not part of the expression. This fixes cases where an expression is immediately followed by something that could be part of the expression. Before this change, calling a function on the result of some subexpression could be written as `@(a - b).abs()`. After this change, that should be changed to `@((a - b).abs())` unless the intent is to have the result of (a - b) followed by the template string `.abs()`. Fixes #64.
I've been migrating from Java to Rust with ructe, and got into a problem which I don't now how to solve. So I have a number of SQL temples like this one, and they cannot be compiled:
I got:
Please, consider to implement rocker-like eval expressions from the beast Java template engine I've ever seen. Everything outside
@(...)
should be treated as a template text, not as an expression.I know that there already was #2 but I still don't know to make my templates work.
The text was updated successfully, but these errors were encountered: