function Parser::parseImportCall
Parses an import call
Return value
Node\Node|null
1 call to Parser::parseImportCall()
- Parser::parseLeftHandSideExpression in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses a left hand side expression
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php, line 3986
Class
- Parser
- Parser class
Namespace
Peast\SyntaxCode
protected function parseImportCall() {
if (($token = $this->scanner
->consume("import")) && $this->scanner
->consume("(")) {
if (($source = $this->isolateContext(array(
"allowIn" => true,
), "parseAssignmentExpression")) && $this->scanner
->consume(")")) {
$node = $this->createNode("ImportExpression", $token);
$node->setSource($source);
return $this->completeNode($node);
}
$this->error();
}
return null;
}