diff options
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index f1f348ff4..afead99c6 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -5370,6 +5370,9 @@ bool parse_file(Parser *p, AstFile *f) { } f->total_file_decl_count += calc_decl_count(stmt); + if (stmt->kind == Ast_WhenStmt || stmt->kind == Ast_ExprStmt || stmt->kind == Ast_ImportDecl) { + f->delayed_decl_count += 1; + } } } @@ -5381,6 +5384,10 @@ bool parse_file(Parser *p, AstFile *f) { u64 end = time_stamp_time_now(); f->time_to_parse = cast(f64)(end-start)/cast(f64)time_stamp__freq(); + for (int i = 0; i < AstDelayQueue_COUNT; i++) { + mpmc_init(f->delayed_decls_queues+i, heap_allocator(), f->delayed_decl_count); + } + return f->error_count == 0; } |