parseAsync method
Implementation
Future<List<AstNode>> parseAsync(List<Token> tokens) async {
reset();
this.tokens = tokens;
List<Future<AstNode>> futures = [];
while (!isAtEnd()) {
futures.add(Future(() => declaration()));
// Skip to the next top-level declaration
synchronizeToNextDeclaration();
}
return await Future.wait(futures);
}