fix: 编译遇到词法错误立即终止
This commit is contained in:
parent
e9939e73c1
commit
f4568f82a4
@ -86,6 +86,9 @@ public class LexerEngine {
|
|||||||
}
|
}
|
||||||
TokenPrinter.print(this.tokens);
|
TokenPrinter.print(this.tokens);
|
||||||
LexerEngine.report(this.getErrors());
|
LexerEngine.report(this.getErrors());
|
||||||
|
if (!errors.isEmpty()) {
|
||||||
|
throw new LexicalException("Lexing failed with " + errors.size() + " error(s).", this.context.getLine(), this.context.getCol());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user