function Scanner::noLineTerminators
Checks that there are not line terminators following the current scan position before next token
Parameters
bool $nextToken By default it checks the current token position: relative to the current position, if this parameter is true the check will be done relative to the next token
Return value
bool
1 call to Scanner::noLineTerminators()
- Scanner::isBefore in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Checks if one of the given strings follows the current scan position
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php, line 738
Class
- Scanner
- Base class for scanners.
Namespace
Peast\SyntaxCode
public function noLineTerminators($nextToken = false) {
if ($nextToken) {
$nextToken = $this->getNextToken();
$refLine = !$nextToken ? null : $nextToken->location->end
->getLine();
}
else {
$refLine = $this->getPosition()
->getLine();
}
$token = $this->currentToken ?: $this->getToken();
return $token && $token->location->start
->getLine() === $refLine;
}