Skip to content

improve error diagnostic

Latest
Compare
Choose a tag to compare
@iiicp iiicp released this 03 Mar 17:19
· 30 commits to main since this release

1, Add a diagnostic engine
2,An error was encountered during the parsing process, and the parser will still continue

eg: output the following error

[Parser.cc:274]:../tests/c/decl_09.c:1:1: error: expect storage class or type specifier or qualifier
main(void) {
^
[Parser.cc:2141]:../tests/c/decl_09.c:5:9: error: the beginning of external declaration
int f();{}
        ^
[Parser.cc:2053]:../tests/c/decl_09.c:8:9: error: expect semi after this
  int a:12
        ^