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

Breadcrumb

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

function Parser::parseForBinding

Parses a binding pattern or an identifier that come after a const or let declaration in a for statement definition

Return value

Node\VariableDeclarator|null

2 calls to Parser::parseForBinding()
Parser::parseForDeclaration in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a let or const declaration in a for statement definition
Parser::parseForVarStatement in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a for(var ...) statement

File

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

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parseForBinding() {
    if (($id = $this->parseIdentifier(static::$bindingIdentifier)) || ($id = $this->parseBindingPattern())) {
        $node = $this->createNode("VariableDeclarator", $id);
        $node->setId($id);
        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