function ParserAbstract::assertEndOfStatement
Asserts that a valid end of statement follows the current position
Return value
boolean
Throws
12 calls to ParserAbstract::assertEndOfStatement()
- Parser::parseBreakStatement in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses a break statement
- Parser::parseContinueStatement in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses a continue statement
- Parser::parseDebuggerStatement in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses a debugger statement
- 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::parseExportDeclaration in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Parser.php - Parses an export declaration
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ ParserAbstract.php, line 315
Class
- ParserAbstract
- Base class for parsers.
Namespace
Peast\SyntaxCode
protected function assertEndOfStatement() {
//The end of statement is reached when it is followed by line
//terminators, end of source, "}" or ";". In the last case the token
//must be consumed
if (!$this->scanner
->noLineTerminators()) {
return true;
}
else {
if ($this->scanner
->consume(";")) {
return true;
}
$token = $this->scanner
->getToken();
if (!$token || $token->value === "}") {
return true;
}
}
$this->error();
}