aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-05-27 23:46:08 +0100
committergingerBill <bill@gingerbill.org>2018-05-27 23:46:08 +0100
commit4e203feaf45d1f3beb9f18ead4f20553b52e11f9 (patch)
tree2f6bec29133c9045d495a608e489cbc7a5030778 /src/parser.cpp
parenta513b477803c94408be5c6f0d6ae6282ade00ba4 (diff)
Change import lookup
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 61aac5a97..4f35568d7 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -4366,6 +4366,11 @@ struct ParserThreadWork {
isize import_index;
};
+void add_shared_package(Parser *p, String name, TokenPos pos, PackageKind kind) {
+ String s = get_fullpath_core(heap_allocator(), name);
+ try_add_import_path(p, s, s, pos, kind);
+}
+
ParseFileError parse_packages(Parser *p, String init_filename) {
GB_ASSERT(init_filename.text[init_filename.len] == 0);
@@ -4384,9 +4389,7 @@ ParseFileError parse_packages(Parser *p, String init_filename) {
isize shared_package_count = 0;
if (!build_context.generate_docs) {
- String s = get_fullpath_core(heap_allocator(), str_lit("runtime"));
- try_add_import_path(p, s, s, init_pos, Package_Runtime);
- shared_package_count++;
+ add_shared_package(p, str_lit("runtime"), init_pos, Package_Runtime); shared_package_count++;
}
array_add(&p->imports, init_imported_package);