From: Fabien Potencier Date: Tue, 14 Dec 2010 15:23:56 +0000 (+0100) Subject: removed support for foo.% which does not make sense X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=20970419b4e2b9e9235682d4ccb52e1c16185dbc;p=web%2Fkonrad%2Ftwig.git removed support for foo.% which does not make sense --- diff --git a/lib/Twig/ExpressionParser.php b/lib/Twig/ExpressionParser.php index 5522941..323c420 100644 --- a/lib/Twig/ExpressionParser.php +++ b/lib/Twig/ExpressionParser.php @@ -235,7 +235,13 @@ class Twig_ExpressionParser $type = Twig_Node_Expression_GetAttr::TYPE_ANY; if ($token->getValue() == '.') { $token = $this->parser->getStream()->next(); - if ($token->getType() == Twig_Token::NAME_TYPE || $token->getType() == Twig_Token::NUMBER_TYPE || $token->getType() == Twig_Token::OPERATOR_TYPE) { + if ( + $token->getType() == Twig_Token::NAME_TYPE + || + $token->getType() == Twig_Token::NUMBER_TYPE + || + ($token->getType() == Twig_Token::OPERATOR_TYPE && preg_match(Twig_Lexer::REGEX_NAME, $token->getValue())) + ) { $arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno); if ($this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '(')) {