function Parser::parsePropertyName
Parses a property name. The returned value is an array where there first element is the property name and the second element is a boolean indicating if it's a computed property
Return value
array|null
3 calls to Parser::parsePropertyName()
- Parser::parseBindingProperty in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses a property in an object binding pattern
- Parser::parseClassElementName in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses a property name. The returned value is an array where there first element is the property name and the second element is a boolean indicating if it's a computed property
- Parser::parsePropertyDefinition in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses a property in an object literal
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php, line 2498
Class
- Parser
- Parser class
Namespace
Peast\SyntaxCode
protected function parsePropertyName() {
if ($token = $this->scanner
->consume("[")) {
if (($name = $this->isolateContext(array(
"allowIn" => true,
), "parseAssignmentExpression")) && $this->scanner
->consume("]")) {
return array(
$name,
true,
$token,
);
}
$this->error();
}
elseif ($name = $this->parseIdentifier(static::$identifierName)) {
return array(
$name,
false,
);
}
elseif ($name = $this->parseStringLiteral()) {
return array(
$name,
false,
);
}
elseif ($name = $this->parseNumericLiteral()) {
return array(
$name,
false,
);
}
return null;
}