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
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\SyntaxCode
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;
}