summaryrefslogtreecommitdiff
path: root/tnslc/compile/module.tnsl
diff options
context:
space:
mode:
authorKai Gunger <kgunger12@gmail.com>2025-12-02 23:19:53 -0500
committerKai Gunger <kgunger12@gmail.com>2025-12-02 23:19:53 -0500
commitc06f8eb6a30a74a589537fc4d77be1c334edae72 (patch)
tree6aebf71d22b90d49aea6229993f48524dad63194 /tnslc/compile/module.tnsl
parent82d11944094349e7c4795659dac45fea954223e2 (diff)
[tnslc] resolve types for structs and functions
Diffstat (limited to 'tnslc/compile/module.tnsl')
-rw-r--r--tnslc/compile/module.tnsl22
1 files changed, 14 insertions, 8 deletions
diff --git a/tnslc/compile/module.tnsl b/tnslc/compile/module.tnsl
index 9d362c8..0cfaa37 100644
--- a/tnslc/compile/module.tnsl
+++ b/tnslc/compile/module.tnsl
@@ -171,8 +171,9 @@ struct Module {
#
/; find (int stype, ~utils.Vector key) [~void]
- _printf("==== STARTING FIND WITH KEY ====\n\0")
- _print_num("key parts %d\n\0", key`.count)
+ /; if (key`.count < 1)
+ return NULL
+ ;/
return self._find(stype, key, 0)
;/
@@ -194,19 +195,24 @@ struct Module {
;/
;; else
~uint8 str = key`.get(key`.count - 1)
+ ~void out = NULL
/; if (stype == SEARCH_VAR)
- return self._find_var(str)
+ out = self._find_var(str)
;; else if (stype == SEARCH_STRUCT)
- return self._find_struct(str)
+ out = self._find_struct(str)
;; else if (stype == SEARCH_FUNC)
- return self._find_func(str)
+ out = self._find_func(str)
;; else if (stype == SEARCH_SUB)
- return self._find_sub(str)
+ out = self._find_sub(str)
;/
- ;/
+ /; if (out !== NULL)
+ return out
+ ;/
+ ;/
+
/; if (lvl == 0 && self.parent !== NULL)
- return self.parent._find(stype, key, 0)
+ return self.parent`._find(stype, key, 0)
;/
return NULL