You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
About the implementation, I guess that a parseWithoutContext(TokenStream $stream) function could be the easier, it would just update an internal flag such as the current lint flag and will use this flag during function / name resolution.
Example
The following code would then be valid and its results could be used to construct what I want to achieve.
For the record, this is my function to be able to parse without giving names context. This can be extended to create a simple "variable extractor" that can fetch variable values from another source:
Description
Current
parse
function requires full context to complete successfully. It needs to know about declaredfunction
s andname
s.I would like to be able to parse the nodes without those details. I have 2 use case for this:
is_granted()
receives 2 argumentsFrom my understanding, the parser need to be updated to avoid throwing on the following lines:
https://github.com/symfony/expression-language/blob/83e1fee4c018aa60bcbbecd585a2c54af6aca905/Parser.php#L228-L249
Alternatively it could be possible to code my own parser based on the existing one, but it cannot be overridden:
https://github.com/symfony/expression-language/blob/83e1fee4c018aa60bcbbecd585a2c54af6aca905/ExpressionLanguage.php#L150
Implementation
About the implementation, I guess that a
parseWithoutContext(TokenStream $stream)
function could be the easier, it would just update an internal flag such as the currentlint
flag and will use this flag duringfunction
/name
resolution.Example
The following code would then be valid and its results could be used to construct what I want to achieve.
The text was updated successfully, but these errors were encountered: