Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Parser.php

function Parser::parsePostfixExpression

Parses a postfix expression

Return value

Node\Node|null

1 call to Parser::parsePostfixExpression()
Parser::parseUnaryExpression in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a unary expression

File

vendor/mck89/peast/lib/Peast/Syntax/Parser.php, line 3277

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parsePostfixExpression() {
    if ($argument = $this->parseLeftHandSideExpression()) {
        if ($this->scanner
            ->noLineTerminators() && ($token = $this->scanner
            ->consumeOneOf($this->postfixOperators))) {
            if ($argument->getType() === "ChainExpression") {
                $this->error("Optional chain can't appear in left-hand side");
            }
            $node = $this->createNode("UpdateExpression", $argument);
            $node->setOperator($token->value);
            $node->setArgument($argument);
            return $this->completeNode($node);
        }
        return $argument;
    }
    return null;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal