function TokenStream::skipLeft
Parameters
int|string|(int|string)[] $skipTokenType :
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Internal/ TokenStream.php, line 102
Class
- TokenStream
- Provides operations on token streams, for use by pretty printer.
Namespace
PhpParser\InternalCode
public function skipLeft(int $pos, $skipTokenType) : int {
$tokens = $this->tokens;
$pos = $this->skipLeftWhitespace($pos);
if ($skipTokenType === \T_WHITESPACE) {
return $pos;
}
if (!$tokens[$pos]->is($skipTokenType)) {
// Shouldn't happen. The skip token MUST be there
throw new \Exception('Encountered unexpected token');
}
$pos--;
return $this->skipLeftWhitespace($pos);
}