aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index 004df85..e35419a 100644
--- a/main.c
+++ b/main.c
@@ -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();
}