function Parser::parseStringLiteral
Parses a string literal
Return value
Node\StringLiteral|null
6 calls to Parser::parseStringLiteral()
- Parser::parseDirectivePrologues in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parse directive prologues. The result is an array where the first element is the array of parsed nodes and the second element is the array of directive prologues values
- Parser::parseFromClause in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses the from keyword and the following string in import and export declarations
- Parser::parseImportDeclaration in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses an import declaration
- Parser::parseLiteral in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses a literal
- Parser::parseModuleExportName in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses an export name
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php, line 3835
Class
- Parser
- Parser class
Namespace
Peast\SyntaxCode
protected function parseStringLiteral() {
$token = $this->scanner
->getToken();
if ($token && $token->type === Token::TYPE_STRING_LITERAL) {
$val = $token->value;
$this->checkInvalidEscapeSequences($val);
$this->scanner
->consumeToken();
$node = $this->createNode("StringLiteral", $token);
$node->setRaw($val);
return $this->completeNode($node);
}
return null;
}