public function Twig_ExpressionParser::parsePostfixExpression in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/twig/twig/lib/Twig/ExpressionParser.php \Twig_ExpressionParser::parsePostfixExpression()
2 calls to Twig_ExpressionParser::parsePostfixExpression()
- Twig_ExpressionParser::getPrimary in vendor/
twig/ twig/ lib/ Twig/ ExpressionParser.php - Twig_ExpressionParser::parsePrimaryExpression in vendor/
twig/ twig/ lib/ Twig/ ExpressionParser.php
File
- vendor/
twig/ twig/ lib/ Twig/ ExpressionParser.php, line 294
Class
- Twig_ExpressionParser
- Parses expressions.
Code
public function parsePostfixExpression($node) {
while (true) {
$token = $this->parser
->getCurrentToken();
if ($token
->getType() == Twig_Token::PUNCTUATION_TYPE) {
if ('.' == $token
->getValue() || '[' == $token
->getValue()) {
$node = $this
->parseSubscriptExpression($node);
}
elseif ('|' == $token
->getValue()) {
$node = $this
->parseFilterExpression($node);
}
else {
break;
}
}
else {
break;
}
}
return $node;
}