forked from twigphp/Twig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark implicit macro argument default values as such with an attribute
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 `isImplicit`, 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](twigphp#4003). For example, a static analysis tool might consider arguments with no explicit default value as non-optional.
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters