-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[ExpressionLanguage] # character in a string literal #11433
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
Comments
It seems to have a special meaning. But I can not see what for. |
I noticed the regex. That's how I figured out I could use single quoted strings as a workaround, but I did not find anything beyond the regex, that's why I'm asking. |
It seems this is a leftover from the Twig copying. The original PR #8913 mentions its based on Twig Expression. Now looking at Twig documentation, the And in Twig, String Interpolation is handled separately in the lexing process. Now for the 100 dollar question, should String Interpolation added to the ExpressionLanguage or should the matching of |
The expression language does not support string interpolation. So, that's a left over that should be removed to fix this issue. Anyone willing to provide a PR? |
Sure, I will. |
…ontaining sharps (pylebecq) This PR was merged into the 2.4 branch. Discussion ---------- [ExpressionLanguage] Fixed double quoted string literals containing sharps | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #11433 | License | MIT | Doc PR | n/a Commits ------- 0c2622e [ExpressionLanguage] Fixed an issue with # characters in double quoted string literals
Sorry for commenting on this closed issue. I just wanted to ask if the asterisk has a functionality too? /**
* @Assert\Expression(
* "!(this.type in [
* constant('App\\Domain\\Model\\Foo\\Foo::bar'),
* constant('App\\Domain\\Model\\Foo\\Foo::baz')
* ] and value == null)"
* )
*/ Throwing:
Not sure if this woul happen using YAML too: |
Hello. |
Hey there,
It seems
#
character in string literals breaks the expression parsing but only when using double quotes as a string delimiter.Some pseudo code to illustrate this:
Does the
#
character mean something ? Why is there a difference between single and double quoted strings ?I did not find anything related to this in the documentation, and I think the answers to these questions have to be documented somewhere.
The text was updated successfully, but these errors were encountered: