public function Twig_ExpressionParser::parsePostfixExpression

2 calls to Twig_ExpressionParser::parsePostfixExpression()
Twig_ExpressionParser::getPrimary in drupal/core/vendor/twig/twig/lib/Twig/ExpressionParser.php
Twig_ExpressionParser::parsePrimaryExpression in drupal/core/vendor/twig/twig/lib/Twig/ExpressionParser.php

File

drupal/core/vendor/twig/twig/lib/Twig/ExpressionParser.php, line 277

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;
}