Minimize package size

This commit is contained in:
Krzosa Karol
2024-04-14 09:27:47 +02:00
parent 320a13ddfd
commit 34f83e444f
15 changed files with 71 additions and 68 deletions

View File

@@ -373,16 +373,14 @@ struct LC_ASTFile {
LC_Token *doc_comment;
};
struct LC_ASTPackage {
LC_Intern name;
LC_DeclState state;
LC_String path;
// To minimize package ast size, we want all nodes to be equal in size,
// a lot of things are easier then and we can loop through all asts for free etc.
typedef struct LC_ASTPackageExt LC_ASTPackageExt;
struct LC_ASTPackageExt {
LC_StringList injected_filepaths; // to sidestep regular file finding, implement single file packages etc.
LC_AST *ffile;
LC_AST *lfile;
LC_Token *doc_comment;
// These are resolved later:
// @todo: add foreign name?
LC_Decl *first_ordered;
@@ -390,6 +388,14 @@ struct LC_ASTPackage {
DeclScope *scope;
};
struct LC_ASTPackage {
LC_DeclState state;
LC_Intern name;
LC_String path;
LC_Token *doc_comment;
LC_ASTPackageExt *ext;
};
struct LC_ASTNoteList {
LC_AST *first;
LC_AST *last;