summaryrefslogtreecommitdiff
path: root/tnslc/compile/var.tnsl
diff options
context:
space:
mode:
authorKai Gunger <kgunger12@gmail.com>2026-05-07 02:00:45 -0400
committerKai Gunger <kgunger12@gmail.com>2026-05-07 02:00:45 -0400
commitb140289c4064d3a813d0d3d8a4ffb65ba684c733 (patch)
tree82af71679b15e83511f021249564d8844b653fe8 /tnslc/compile/var.tnsl
parent8ffb50a4bc61b51952aa78da0c6e1f002f09e1be (diff)
[tnslc] fix members in binary operations
Diffstat (limited to 'tnslc/compile/var.tnsl')
-rw-r--r--tnslc/compile/var.tnsl21
1 files changed, 21 insertions, 0 deletions
diff --git a/tnslc/compile/var.tnsl b/tnslc/compile/var.tnsl
index 9c7c042..63758ea 100644
--- a/tnslc/compile/var.tnsl
+++ b/tnslc/compile/var.tnsl
@@ -207,6 +207,12 @@ struct Var {
return chk` == ptype
;/
+ /; strip_refs
+ /; loop (self.is_ptrc(0, 0) == true)
+ self.ptr_pop()
+ ;/
+ ;/
+
# Returns true if the variable is a reference
/; is_ref [bool]
return self.is_ptrc(0, 0)
@@ -1098,6 +1104,21 @@ struct Var {
;/
/; if (out{0} == '[')
+ utils.Vector vout
+ uint ts = self.type_size()
+ /; if (ts == 1)
+ vout.from_cstr("byte \0")
+ ;; else if (ts == 2)
+ vout.from_cstr("word \0")
+ ;; else if (ts == 4)
+ vout.from_cstr("dword \0")
+ ;; else if (ts == 8)
+ vout.from_cstr("qword \0")
+ ;/
+ vout.push_cstr(out)
+
+ _delete(out)
+ out = vout.as_cstr()
;/
return out