function Parser::parseDefaultClause
Parses default case in a switch statement
Return value
Node\SwitchCase|null
1 call to Parser::parseDefaultClause()
- Parser::parseCaseBlock in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses the content of a switch statement
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php, line 952
Class
- Parser
- Parser class
Namespace
Peast\SyntaxCode
protected function parseDefaultClause() {
if ($token = $this->scanner
->consume("default")) {
if ($this->scanner
->consume(":")) {
$node = $this->createNode("SwitchCase", $token);
if ($consequent = $this->parseStatementList()) {
$node->setConsequent($consequent);
}
return $this->completeNode($node);
}
$this->error();
}
return null;
}