aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parser.c b/src/parser.c
index e9c1a9a44..c3005ddb7 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1197,7 +1197,11 @@ Token expect_token(AstFile *f, TokenKind kind) {
syntax_error(f->curr_token, "Expected `%.*s`, got `%.*s`",
LIT(token_strings[kind]),
LIT(token_strings[prev.kind]));
+ if (prev.kind == Token_EOF) {
+ gb_exit(1);
+ }
}
+
next_token(f);
return prev;
}