scanTokens method

Future<List<Token>> scanTokens({
  1. bool isBase = true,
})

Implementation

Future<List<Token>> scanTokens({bool isBase = true}) async {
  if (reader != null) {
    Uri u = Uri.parse(reader!.pathOrUrl);
    source = await reader!.read();
    sourceFile = u.pathSegments.last;
  }
  while (!isAtEnd()) {
    start = current;
    await scanToken();
  }
  if (isBase) {
    tokens.add(Token(TokenType.EOF, "", null, line, sourceFile: sourceFile));
  }
  return tokens;
}