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

Breadcrumb

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

function Parser::parseModuleItem

Parses a module item

Return value

Node\Node|null

1 call to Parser::parseModuleItem()
Parser::parseModuleItemList in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a module item list

File

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

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function parseModuleItem() {
    if ($item = $this->parseImportDeclaration()) {
        return $item;
    }
    elseif ($item = $this->parseExportDeclaration()) {
        return $item;
    }
    elseif ($item = $this->isolateContext(array(
        "allowYield" => false,
        "allowReturn" => false,
        "allowAwait" => $this->features->topLevelAwait,
    ), "parseStatementListItem")) {
        return $item;
    }
    return null;
}

API Navigation

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