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

Breadcrumb

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

function Parser::parseYieldExpression

Parses yield statement

Return value

Node\YieldExpression|null

1 call to Parser::parseYieldExpression()
Parser::parseAssignmentExpression in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses an assignment expression

File

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

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parseYieldExpression() {
    if ($token = $this->scanner
        ->consume("yield")) {
        $node = $this->createNode("YieldExpression", $token);
        if ($this->scanner
            ->noLineTerminators()) {
            $delegate = $this->scanner
                ->consume("*");
            $argument = $this->isolateContext(array(
                "allowYield" => true,
            ), "parseAssignmentExpression");
            if ($argument) {
                $node->setArgument($argument);
                $node->setDelegate($delegate);
            }
        }
        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