Merge branch '1.x' into 2.x

* 1.x:
  Allow trailing commas in macros + functions + filters
This commit is contained in:
Fabien Potencier
2020-07-06 13:59:53 +02:00
5 changed files with 47 additions and 1 deletions
+5
View File
@@ -584,6 +584,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) {