diff options
Diffstat (limited to 'src/index')
| -rw-r--r-- | src/index/indexer.odin | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/index/indexer.odin b/src/index/indexer.odin index 073d32d..e04febd 100644 --- a/src/index/indexer.odin +++ b/src/index/indexer.odin @@ -39,6 +39,7 @@ import "core:sort" Indexer :: struct { + built_in_packages: [dynamic] string, static_index: MemoryIndex, }; @@ -57,11 +58,14 @@ lookup :: proc(name: string, pkg: string, loc := #caller_location) -> (Symbol, b return symbol, true; } - if symbol, ok := memory_index_lookup(&indexer.static_index, name, "builtin"); ok { - log.infof("lookup name: %v pkg: %v, symbol %v location %v", name, pkg, symbol, loc); - return symbol, true; - } + for built in indexer.built_in_packages { + if symbol, ok := memory_index_lookup(&indexer.static_index, name, built); ok { + log.infof("lookup name: %v pkg: %v, symbol %v location %v", name, pkg, symbol, loc); + return symbol, true; + } + + } log.infof("lookup failed name: %v pkg: %v location %v", name, pkg, loc); return {}, false; |