parseSource method
Convert string content into ASTSource by a certain grammar rules set.
Implementation
ASTSource parseSource(HTSource source,
{bool printPerformanceStatistics = false}) {
final tik = DateTime.now().millisecondsSinceEpoch;
currrentFileName = source.fullName;
resetFlags();
currentModuleImports = <ImportExportDecl>[];
final tokens = lexer.lex(source.content);
final nodes = parseTokens(tokens, source: source);
final result = ASTSource(
nodes: nodes,
source: source,
imports: currentModuleImports,
errors: errors); // copy the list);
final tok = DateTime.now().millisecondsSinceEpoch;
if (printPerformanceStatistics) {
print('hetu: ${tok - tik}ms\tto parse\t[${source.fullName}]');
}
return result;
}