mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 04:16:28 +00:00
Revert "added an exception when a macro re-uses the same argument name twice"
This reverts commit b7a54b0101.
This commit is contained in:
@@ -482,7 +482,7 @@ class Twig_ExpressionParser
|
|||||||
$value = $this->parsePrimaryExpression();
|
$value = $this->parsePrimaryExpression();
|
||||||
|
|
||||||
if (!$this->checkConstantExpression($value)) {
|
if (!$this->checkConstantExpression($value)) {
|
||||||
throw new Twig_Error_Syntax('A default value for an argument must be a constant (a boolean, a string, a number, or an array).', $token->getLine(), $this->parser->getFilename());
|
throw new Twig_Error_Syntax(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $this->parser->getFilename());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$value = $this->parseExpression();
|
$value = $this->parseExpression();
|
||||||
@@ -497,10 +497,6 @@ class Twig_ExpressionParser
|
|||||||
if (null === $name) {
|
if (null === $name) {
|
||||||
$args[] = $value;
|
$args[] = $value;
|
||||||
} else {
|
} else {
|
||||||
if ($definition && isset($args[$name])) {
|
|
||||||
throw new Twig_Error_Syntax(sprintf('Arguments cannot contain the same argument name more than once ("%s" is defined twice).', $name), $token->getLine(), $this->parser->getFilename());
|
|
||||||
}
|
|
||||||
|
|
||||||
$args[$name] = $value;
|
$args[$name] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user