peek method

Token? peek()

Returns the next token without consuming it.

Implementation

Token? peek() {
  if (_streamEndProduced) return null;
  if (!_tokenAvailable) _fetchMoreTokens();
  return _tokens.first;
}