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

Breadcrumb

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

function Parser::initContext

Initializes parser context

Return value

void

Overrides ParserAbstract::initContext

File

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

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function initContext() {
    $context = array(
        "allowReturn" => false,
        "allowIn" => false,
        "allowYield" => false,
        "allowAwait" => false,
    );
    
    //If async/await is not enabled remove the
    
    //relative context properties
    if (!$this->features->asyncAwait) {
        unset($context["allowAwait"]);
        unset($this->contextKeywords["await"]);
    }
    $this->context = (object) $context;
}

API Navigation

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