aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-05-27 10:49:14 +0100
committergingerBill <bill@gingerbill.org>2018-05-27 10:49:14 +0100
commit7ee9051a56ca0c04e6b60f53b9dfe47c75596496 (patch)
tree619c13b7d86105fcfda13d315c0c315e7005630a /src/parser.cpp
parenteb11edabe092541144cd3ba18b09bd11fcf7a958 (diff)
IR now builds with the new package system
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 7e3a79613..1a7ba68a3 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -3831,7 +3831,6 @@ ParseFileError init_ast_file(AstFile *f, String fullpath, TokenPos *err_pos) {
isize init_token_cap = cast(isize)gb_max(next_pow2(cast(i64)(file_size/2ll)), 16);
array_init(&f->tokens, heap_allocator(), 0, gb_max(init_token_cap, 16));
-
if (err == TokenizerInit_Empty) {
Token token = {Token_EOF};
token.pos.file = fullpath;
@@ -4166,6 +4165,9 @@ ParseFileError parse_imported_file(Parser *p, AstPackage *package, FileInfo *fi,
AstFile *file = gb_alloc_item(heap_allocator(), AstFile);
file->package = package;
+ p->file_index += 1;
+ file->id = p->file_index;
+
TokenPos err_pos = {0};
ParseFileError err = init_ast_file(file, fi->fullpath, &err_pos);