aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-07-27 20:45:50 +0100
committergingerBill <bill@gingerbill.org>2021-07-27 20:45:50 +0100
commit9cd5ea59dd091083555d7aea691fcd889e67fb67 (patch)
tree335bd28d0bcaf8b1705d08be10451227f4ddf51d /src/parser.cpp
parent116e98b37891091841976d1c70ec1fb39c439d8a (diff)
Big simplification and improvement of the entity collection system, reducing unneeded steps for packages
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp7
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;
}