summaryrefslogtreecommitdiff
path: root/tnslc/compile
diff options
context:
space:
mode:
authorKai Gunger <kgunger12@gmail.com>2026-07-03 05:01:26 -0400
committerKai Gunger <kgunger12@gmail.com>2026-07-03 05:01:26 -0400
commitfc0262447a128ec8047689ddb885cffa8aa6e2dc (patch)
tree5ad6744e877cf48c78cd54da368c1c5f405637bc /tnslc/compile
parent5a0e41021e7ef474c206688a32020be5435bcb09 (diff)
[tnslc] Fix some parsing issues
Diffstat (limited to 'tnslc/compile')
-rw-r--r--tnslc/compile/function.tnsl3
-rw-r--r--tnslc/compile/var.tnsl6
2 files changed, 7 insertions, 2 deletions
diff --git a/tnslc/compile/function.tnsl b/tnslc/compile/function.tnsl
index 849bae1..2a8363a 100644
--- a/tnslc/compile/function.tnsl
+++ b/tnslc/compile/function.tnsl
@@ -1461,6 +1461,7 @@ struct Function {
s`.free_after(~lhs, true)
;/
+ _printf("COMPILE_BOOL_OP\n\0")
/; if (lhs.is_struct() == true)
_printf("Can not use struct as boolean value\n\0")
lhs.end()
@@ -1512,6 +1513,7 @@ struct Function {
# Compute right hand side
Var rhs = self._compile_value(s, rhn)
+ _printf("COMPILE_BOOL_OP\n\0")
/; if (rhs.is_struct() == true)
_printf("Can not use struct as boolean value\n\0")
lhs.end()
@@ -1601,6 +1603,7 @@ struct Function {
# Compute right hand side
Var rhs = self._compile_value(s, rhn)
+ _printf("COMPILE_CMP_OP\n\0")
# Check not structs
/; if (lhs.is_struct() == true || rhs.is_struct() == true)
_printf("Can not compare structs in this version of tnsl\n\0")
diff --git a/tnslc/compile/var.tnsl b/tnslc/compile/var.tnsl
index 8babc1b..0154931 100644
--- a/tnslc/compile/var.tnsl
+++ b/tnslc/compile/var.tnsl
@@ -944,6 +944,7 @@ struct Var {
# Typechecking structs
/; _tc_struct (~Var other) [bool]
+ _printf("TC_STRUCT\n\0")
/; if (other`.is_struct() == false)
return false
;/
@@ -1237,7 +1238,7 @@ struct Var {
# - If builtin then move based on size (byte, word, dword, qword)
# - If pointer then move qword
# - If struct then move via rep movsb
-
+ _printf("SET\n\0")
/; if (self.is_struct() == true)
# Struct set
self._set_struct(buf, other)
@@ -1314,6 +1315,7 @@ struct Var {
~int32 p = vcpy.ptrc.get(idx)
p` = set
;; else
+ _printf("TAKE_PTR\n\0")
/; if (self.is_struct() == true)
self._set_struct_r(buf, reg)
;; else
@@ -1859,7 +1861,7 @@ struct Var {
;/
/; member (~CompBuf buf, ~uint8 name) [Var]
-
+ _printf("MEMBER\n\0")
/; if (self.is_struct() == false)
_printf("ERROR: Attempted to get a member named \"\0")
_printf(name)