From c3e05f3bac232bfd321dd37f211504368e1d0736 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 2 Oct 2013 21:46:45 +0200 Subject: [PATCH] Revert "added an exception when a macro re-uses the same argument name twice" This reverts commit b7a54b01017becf7f3b90beadc71536b58e2299a. --- lib/Twig/ExpressionParser.php | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/lib/Twig/ExpressionParser.php b/lib/Twig/ExpressionParser.php index 9deab09..8f85745 100644 --- a/lib/Twig/ExpressionParser.php +++ b/lib/Twig/ExpressionParser.php @@ -482,7 +482,7 @@ class Twig_ExpressionParser $value = $this->parsePrimaryExpression(); 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 { $value = $this->parseExpression(); @@ -497,10 +497,6 @@ class Twig_ExpressionParser if (null === $name) { $args[] = $value; } 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; } } -- 1.7.2.5