consume method

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

Implementation

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