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
[ExpressionLanguage] Document precedence #19803
Comments
A note block could be added and document this internal behavior i think yes 👍🏻 |
I really like this note and we should merge it. However, what about a debug command? We have the same for listener priorities |
I'm not sure to understand, there is no command for symfony's expression language, right? |
Yes, I would propose to create one |
What would be the purpose of such command? How do you see its interface? |
I would output the list from the docs PR, if we can get the info programmatically |
Yes we can definitely get it programatically rather easily (minus some formating / arranging). The repo does not have a dependency on the console component, I'm not exactly sure how to approach this. Another command I can think of would be an easy "debug" command where someone could provide an expression (and possibly variables) and get the result. |
Given that the list of operators is very rarely updated, I'd just handle this manually. |
Current status
The page https://symfony.com/doc/current/reference/formats/expression_language.html#supported-operators does not document operators precedence.
Objective
Add documentation about operators precedence.
Why?
Today I wanted to check the precedence of some operator in order to update a code, I had an expression that could translate to the following ambiguity:
We can find the precedence in https://github.com/symfony/expression-language/blob/b8ec919a6d3d47fc4e7845c256d164413207bf73/Parser.php#L24
I think that this information should be accessible in the doc directly, but I understand that it won't benefit a lot of users so I'm wondering how it should be presented. Maybe just a collapsible array at the end, or when the precedence is mentioned in:
The text was updated successfully, but these errors were encountered: