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

Breadcrumb

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

function Parser::checkAsyncFunctionStart

Checks if an async function can start from the current position. Returns the async token or null if not found

Parameters

bool $checkFn If false it won't check if the async keyword is: followed by "function"

Return value

Token

4 calls to Parser::checkAsyncFunctionStart()
Parser::parseArrowFunction in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses an arrow function
Parser::parseFunctionOrGeneratorDeclaration in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses function or generator declaration
Parser::parseFunctionOrGeneratorExpression in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses function or generator expression
Parser::parseMethodDefinition in vendor/mck89/peast/lib/Peast/Syntax/Parser.php
Parses a method definition

File

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

Class

Parser
Parser class

Namespace

Peast\Syntax

Code

protected function checkAsyncFunctionStart($checkFn = true) {
    return ($asyncToken = $this->scanner
        ->getToken()) && $asyncToken->value === "async" && (!$checkFn || ($nextToken = $this->scanner
        ->getNextToken()) && $nextToken->value === "function") && $this->scanner
        ->noLineTerminators(true) ? $asyncToken : null;
}

API Navigation

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