aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/parser.c b/src/parser.c
index b0b2fe4a3..6514e0b20 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1176,6 +1176,11 @@ Token expect_closing(AstFile *f, TokenKind kind, String context) {
}
void expect_semicolon(AstFile *f, AstNode *s) {
+ if (f->prev_token.kind == Token_CloseBrace ||
+ f->prev_token.kind == Token_CloseBrace) {
+ return;
+ }
+
if (f->curr_token.kind != Token_CloseParen &&
f->curr_token.kind != Token_CloseBrace) {
switch (f->curr_token.kind) {
@@ -3267,6 +3272,10 @@ ParseFileError parse_files(Parser *p, char *init_filename) {
ParseFileError err = init_ast_file(&file, import_path);
if (err != ParseFile_None) {
+ if (err == ParseFile_EmptyFile) {
+ return ParseFile_None;
+ }
+
if (pos.line != 0) {
gb_printf_err("%.*s(%td:%td) ", LIT(pos.file), pos.line, pos.column);
}
@@ -3278,9 +3287,6 @@ ParseFileError parse_files(Parser *p, char *init_filename) {
case ParseFile_InvalidFile:
gb_printf_err("Invalid file");
break;
- case ParseFile_EmptyFile:
- gb_printf_err("File is empty");
- break;
case ParseFile_Permission:
gb_printf_err("File permissions problem");
break;