From 592834f7f6c12f99af0d93d8ec7d025a875703d6 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 22 Dec 2010 11:33:29 +0100 Subject: [PATCH] fixed typo --- lib/Twig/ExpressionParser.php | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Twig/ExpressionParser.php b/lib/Twig/ExpressionParser.php index 2a61583..bba2ae3 100644 --- a/lib/Twig/ExpressionParser.php +++ b/lib/Twig/ExpressionParser.php @@ -204,6 +204,7 @@ class Twig_ExpressionParser public function parsePostfixExpression($node) { + $firstPass = true; while (true) { $token = $this->parser->getCurrentToken(); if ($token->getType() == Twig_Token::PUNCTUATION_TYPE) { @@ -211,14 +212,16 @@ class Twig_ExpressionParser $node = $this->parseSubscriptExpression($node); } elseif ('|' == $token->getValue()) { $node = $this->parseFilterExpression($node); - } elseif ($node instanceof Twig_Node_Expression_Name && '(' == $token->getValue()) { - return new Twig_Node_Expression_Function($node, $this->parseArguments(), $node->getLine()); + } elseif ($firstPass && $node instanceof Twig_Node_Expression_Name && '(' == $token->getValue()) { + $node = new Twig_Node_Expression_Function($node, $this->parseArguments(), $node->getLine()); } else { break; } } else { break; } + + $firstPass = false; } return $node; -- 1.7.2.5