aboutsummaryrefslogtreecommitdiff
path: root/src/parser.hpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-05-26 23:12:55 +0100
committergingerBill <bill@gingerbill.org>2018-05-26 23:12:55 +0100
commitc067b90403ab8493daa0bf5867b2bd92319feea5 (patch)
treef8d8162cc7d0e937c925ed8b07831ffc0e9c75de /src/parser.hpp
parent5b6770f3d297c0639bdbe8b1b029616c16669165 (diff)
Add basic package support (no IR support yet)
Diffstat (limited to 'src/parser.hpp')
-rw-r--r--src/parser.hpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/parser.hpp b/src/parser.hpp
index d99562d2e..f1547847f 100644
--- a/src/parser.hpp
+++ b/src/parser.hpp
@@ -67,8 +67,8 @@ struct AstFile {
AstNode * curr_proc;
isize scope_level;
- Scope * scope; // NOTE(bill): Created in checker
- DeclInfo * decl_info; // NOTE(bill): Created in checker
+ // Scope * scope; // NOTE(bill): Created in checker
+ // DeclInfo * decl_info; // NOTE(bill): Created in checker
CommentGroup lead_comment; // Comment (block) before the decl
@@ -84,17 +84,21 @@ struct AstFile {
struct AstPackage {
+ isize id;
ImportedPackageKind kind;
String name;
String fullpath;
Map<AstFile *> files; // Key: String (names)
+
+ Scope * scope; // NOTE(bill): Created in checker
+ DeclInfo *decl_info; // NOTE(bill): Created in checker
};
struct Parser {
String init_fullpath;
- Map<AstPackage *> packages; // Key: String (fullpath)
- Array<AstFile *> files;
+ Map<bool> imported_files; // Key: String (fullpath)
+ Array<AstPackage *> packages;
Array<ImportedPackage> imports;
isize total_token_count;
isize total_line_count;
@@ -351,7 +355,7 @@ AST_NODE_KIND(_DeclBegin, "", struct {}) \
bool been_handled; \
}) \
AST_NODE_KIND(ImportDecl, "import declaration", struct { \
- AstFile *file; \
+ AstPackage *package; \
Token token; \
Token relpath; \
String fullpath; \
@@ -362,7 +366,7 @@ AST_NODE_KIND(_DeclBegin, "", struct {}) \
bool is_using; \
bool been_handled; \
}) \
- AST_NODE_KIND(ExportDecl, "export declaration", struct { \
+ /* AST_NODE_KIND(ExportDecl, "export declaration", struct { \
AstFile *file; \
Token token; \
Token relpath; \
@@ -371,7 +375,7 @@ AST_NODE_KIND(_DeclBegin, "", struct {}) \
CommentGroup docs; \
CommentGroup comment; \
bool been_handled; \
- }) \
+ }) */ \
AST_NODE_KIND(ForeignImportDecl, "foreign import declaration", struct { \
Token token; \
Token filepath; \