consume method

Token consume(
  1. TokenType type,
  2. String message
)

Implementation

Token consume(TokenType type, String message) {
  if (check(type)) return advance();
  throw error(peek(), message);
}