diff options
-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(); } |