scanTokens method

List<Token> scanTokens()

Scans the source and returns the tokens.

Implementation

List<Token> scanTokens() {
  while (!_isAtEnd) {
    _start = _current;
    _scanToken();
  }

  _tokens.add(
    Token(
      type: TokenType.endOfFile,
      lexeme: '',
      offset: _start,
    ),
  );
  return _tokens;
}