addToken method

void addToken(
  1. TokenType type, [
  2. Object? literal
])

Implementation

void addToken(TokenType type, [Object? literal]) {
  String text = source.substring(start, current);
  tokens.add(_getCachedToken(type, text, literal, line));
}