mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-23 08:38:45 +00:00
Merge branch '2.x' into 3.x
* 2.x: Allow trailing commas in macros + functions + filters
This commit is contained in:
@@ -579,6 +579,11 @@ class ExpressionParser
|
||||
while (!$stream->test(/* Token::PUNCTUATION_TYPE */ 9, ')')) {
|
||||
if (!empty($args)) {
|
||||
$stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ',', 'Arguments must be separated by a comma');
|
||||
|
||||
// if the comma above was a trailing comma, early exit the argument parse loop
|
||||
if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, ')')) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($definition) {
|
||||
|
||||
Reference in New Issue
Block a user