public function getNext(): Token
{ if ($this->peeking
) { $this->peeking = false;
$this->used
[] =
$this->peeked;
return $this->peeked;
} if (!
isset($this->tokens
[$this->cursor
])) { throw new InternalErrorException('Unexpected token stream end.'
);
} return $this->tokens
[$this->cursor++
];
} /**
* Returns peeked token.
*/
public function getPeek(): Token
{ if (!
$this->peeking
) {