New concept of AST_MODULE, Ast_File and Ast_Module are now both scopes.

Concept of loading and importing.
This commit is contained in:
Krzosa Karol
2022-06-13 13:39:31 +02:00
parent 8bd5e9638f
commit bcd825c154
8 changed files with 132 additions and 75 deletions

View File

@@ -167,21 +167,7 @@ struct Ast_Scope;
struct Ast_Decl;
struct Ast_File_Namespace;
struct Ast_File;
struct Ast_Module{
Intern_String name;
Array<Ast_File *> files;
};
struct Ast_File{
Intern_String filename;
Ast_Module *module;
B32 global_implicit_load;
String filecontent;
Intern_String name;
Ast_Scope *scope;
};
struct Ast_Module;
struct Parse_Ctx:Lexer{
Allocator *perm; // Stores: AST, tokens, interns
Allocator *heap;
@@ -190,7 +176,6 @@ struct Parse_Ctx:Lexer{
Map type_map;
Array<Ast_Module *> modules;
Array<Ast_File_Namespace *> packages;
Ast_Scope *currently_parsed_scope;
Ast_File *currently_parsed_file;
Array<Ast_Decl *> ordered_decls;