fix: 编译遇到词法错误立即终止

This commit is contained in:
Luke 2025-06-30 23:42:14 +08:00
parent e9939e73c1
commit f4568f82a4

View File

@ -86,6 +86,9 @@ public class LexerEngine {
}
TokenPrinter.print(this.tokens);
LexerEngine.report(this.getErrors());
if (!errors.isEmpty()) {
throw new LexicalException("Lexing failed with " + errors.size() + " error(s).", this.context.getLine(), this.context.getCol());
}
}
/**