Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #4010 Mark implicit macro argument default values as such wit…
…h an attribute in AST (drjayvee) This PR was squashed before being merged into the 3.x branch. Discussion ---------- Mark implicit macro argument default values as such with an attribute in AST This change causes no difference to compiled templates or to macro argument semantics. Consider the following macro: ```twig {% macro marco(po, lo = null) %}{% endmacro %} ``` With this change, the `ConstantExpression` for argument `po` will have an attribute `is_implicit`, whose value will be `true`. (Note that `lo` will not have that attribute.) This allows node visitors to distinguish between arguments that do and those that do not have explicit default values even if the value is `null`. This is useful for [static code analysis](#4003). For example, a static analysis tool might consider arguments with no explicit default value as non-optional. Commits ------- e83a802 Mark implicit macro argument default values as such with an attribute in AST
- Loading branch information