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

Breadcrumb

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

function Parser::parseExpressionStatement

Parses an expression statement

Return value

Node\ExpressionStatement|null

1 call to Parser::parseExpressionStatement()
Parser::parseStatement in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a statement

File

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

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parseExpressionStatement() {
    $lookaheadTokens = array(
        "{",
        "function",
        "class",
        array(
            "let",
            "[",
        ),
    );
    if ($this->features->asyncAwait) {
        array_splice($lookaheadTokens, 3, 0, array(
            array(
                "async",
                true,
            ),
        ));
    }
    if (!$this->scanner
        ->isBefore($lookaheadTokens, true) && ($expression = $this->isolateContext(array(
        "allowIn" => true,
    ), "parseExpression"))) {
        $this->assertEndOfStatement();
        $node = $this->createNode("ExpressionStatement", $expression);
        $node->setExpression($expression);
        return $this->completeNode($node);
    }
    return null;
}

API Navigation

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