From 9cd5ea59dd091083555d7aea691fcd889e67fb67 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 27 Jul 2021 20:45:50 +0100 Subject: Big simplification and improvement of the entity collection system, reducing unneeded steps for packages --- src/parser.hpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/parser.hpp') diff --git a/src/parser.hpp b/src/parser.hpp index b3bdfd15d..d7d972f9e 100644 --- a/src/parser.hpp +++ b/src/parser.hpp @@ -83,6 +83,11 @@ enum AstFileFlag : u32 { AstFile_IsLazy = 1<<2, }; +enum AstDelayQueueKind { + AstDelayQueue_Import, + AstDelayQueue_Expr, + AstDelayQueue_COUNT, +}; struct AstFile { i32 id; @@ -113,6 +118,7 @@ struct AstFile { bool allow_type; isize total_file_decl_count; + isize delayed_decl_count; Slice decls; Array imports; // 'import' isize directive_count; @@ -128,6 +134,9 @@ struct AstFile { CommentGroup *docs; // current docs Array comments; // All the comments! + // TODO(bill): make this a basic queue as it does not require + // any multiple thread capabilities + MPMCQueue delayed_decls_queues[AstDelayQueue_COUNT]; #define PARSER_MAX_FIX_COUNT 6 isize fix_count; @@ -151,6 +160,11 @@ struct AstForeignFile { }; +struct AstPackageExportedEntity { + Ast *identifier; + Entity *entity; +}; + struct AstPackage { PackageKind kind; isize id; @@ -160,10 +174,11 @@ struct AstPackage { Array foreign_files; bool is_single_file; + MPMCQueue exported_entity_queue; + // NOTE(bill): Created/set in checker Scope * scope; DeclInfo *decl_info; - bool used; bool is_extra; }; -- cgit v1.2.3