diff options
| author | gingerBill <bill@gingerbill.org> | 2021-07-27 20:45:50 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-07-27 20:45:50 +0100 |
| commit | 9cd5ea59dd091083555d7aea691fcd889e67fb67 (patch) | |
| tree | 335bd28d0bcaf8b1705d08be10451227f4ddf51d /src/parser.hpp | |
| parent | 116e98b37891091841976d1c70ec1fb39c439d8a (diff) | |
Big simplification and improvement of the entity collection system, reducing unneeded steps for packages
Diffstat (limited to 'src/parser.hpp')
| -rw-r--r-- | src/parser.hpp | 17 |
1 files changed, 16 insertions, 1 deletions
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<Ast *> decls; Array<Ast *> imports; // 'import' isize directive_count; @@ -128,6 +134,9 @@ struct AstFile { CommentGroup *docs; // current docs Array<CommentGroup *> comments; // All the comments! + // TODO(bill): make this a basic queue as it does not require + // any multiple thread capabilities + MPMCQueue<Ast *> 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<AstForeignFile> foreign_files; bool is_single_file; + MPMCQueue<AstPackageExportedEntity> exported_entity_queue; + // NOTE(bill): Created/set in checker Scope * scope; DeclInfo *decl_info; - bool used; bool is_extra; }; |