aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-08-20 18:28:21 +0100
committerGinger Bill <bill@gingerbill.org>2017-08-20 18:28:21 +0100
commit6c73f9d3fdc0249485ffc1e3314f1ed2750b60d0 (patch)
treed9b27647cceb4a1bee53b37a48091f11b29c6f17 /src/parser.cpp
parent1161aa829d0823cfa3e2f4c93160b7b94b4b0a5c (diff)
Global variable dependency initialization ordering
Fuck graph theory
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index de2da964a..e504a0d62 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -5086,10 +5086,11 @@ ParseFileError parse_files(Parser *p, String init_filename) {
array_add(&p->imports, runtime_file);
shared_file_count++;
}
+
array_add(&p->imports, init_imported_file);
p->init_fullpath = init_fullpath;
-
+/*
// IMPORTANT TODO(bill): Figure out why this doesn't work on *nix sometimes
#if USE_THREADED_PARSER && defined(GB_SYSTEM_WINDOWS)
isize thread_count = gb_max(build_context.thread_count, 1);
@@ -5148,14 +5149,15 @@ ParseFileError parse_files(Parser *p, String init_filename) {
}
}
}
-#else
- for_array(i, p->imports) {
- ParseFileError err = parse_import(p, p->imports[i]);
+#else */
+ isize import_index = 0;
+ for (; import_index < p->imports.count; import_index++) {
+ ParseFileError err = parse_import(p, p->imports[import_index]);
if (err != ParseFile_None) {
return err;
}
}
-#endif
+// #endif
for_array(i, p->files) {
p->total_token_count += p->files[i].tokens.count;