advance method

Token advance()

Consumes and returns the current token, advancing the parser state. Returns the previous token (the one just consumed).

Implementation

Token advance() {
  if (!isAtEnd()) current++;
  return previous();
}