diff options
author | Michael Forney <mforney@mforney.org> | 2021-09-03 14:21:03 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2021-09-03 14:21:03 -0700 |
commit | 6f874e47b62705b28175b135b3372a19a8108bf3 (patch) | |
tree | 6677ad575a55e1740965d6d46442a780d7fd4eea | |
parent | e2855dd3223f83e7638d1698622861d5e98cb1b2 (diff) | |
download | cproc-6f874e47b62705b28175b135b3372a19a8108bf3.tar.xz |
main: Add specialized error message for stray ';' at toplevel
-rw-r--r-- | main.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -58,8 +58,11 @@ main(int argc, char *argv[]) } else { scopeinit(); while (tok.kind != TEOF) { - if (!decl(&filescope, NULL)) + if (!decl(&filescope, NULL)) { + if (tok.kind == TSEMICOLON) + error(&tok.loc, "unexpected ';' at top-level"); error(&tok.loc, "expected declaration or function definition"); + } } emittentativedefns(); } |