function Parser::parseJSXSpreadAttribute
Parses a jsx spread attribute
Return value
\Peast\Syntax\Node\JSX\JSXSpreadAttribute|null
1 call to Parser::parseJSXSpreadAttribute()
- Parser::parseJSXAttributes in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ JSX/ Parser.php - Parses a jsx attributes list
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ JSX/ Parser.php, line 338
Class
- Parser
- JSX parser trait
Namespace
Peast\Syntax\JSXCode
protected function parseJSXSpreadAttribute() {
if (!($openToken = $this->scanner
->consume("{"))) {
return null;
}
if ($this->scanner
->consume("...") && ($exp = $this->parseAssignmentExpression()) && $this->scanner
->consume("}")) {
$node = $this->createJSXNode("JSXSpreadAttribute", $openToken);
$node->setArgument($exp);
return $this->completeNode($node);
}
$this->error();
}