You are here

public function Twig_ExpressionParser::parsePostfixExpression in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/ExpressionParser.php \Twig_ExpressionParser::parsePostfixExpression()
2 calls to Twig_ExpressionParser::parsePostfixExpression()
Twig_ExpressionParser::getPrimary in vendor/Twig/ExpressionParser.php
Twig_ExpressionParser::parsePrimaryExpression in vendor/Twig/ExpressionParser.php

File

vendor/Twig/ExpressionParser.php, line 279

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