use the passed $token in isUnary and isBinary of ExpressionParser
authornikic <+@ni-po.com>
Mon, 20 Dec 2010 17:27:01 +0000 (18:27 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Mon, 20 Dec 2010 18:00:22 +0000 (19:00 +0100)
lib/Twig/ExpressionParser.php

index 5f6b06c..f6c4a8c 100644 (file)
@@ -101,12 +101,12 @@ class Twig_ExpressionParser
 
     protected function isUnary(Twig_Token $token)
     {
-        return $this->parser->getStream()->test(Twig_Token::OPERATOR_TYPE) && isset($this->unaryOperators[$token->getValue()]);
+        return $token->test(Twig_Token::OPERATOR_TYPE) && isset($this->unaryOperators[$token->getValue()]);
     }
 
     protected function isBinary(Twig_Token $token)
     {
-        return $this->parser->getStream()->test(Twig_Token::OPERATOR_TYPE) && isset($this->binaryOperators[$token->getValue()]);
+        return $token->test(Twig_Token::OPERATOR_TYPE) && isset($this->binaryOperators[$token->getValue()]);
     }
 
     public function parsePrimaryExpression($assignment = false)