summaryrefslogtreecommitdiff
path: root/tnslc/compile/function.tnsl
diff options
context:
space:
mode:
authorCircleShift <kgunger12@gmail.com>2025-12-31 00:59:22 -0500
committerCircleShift <kgunger12@gmail.com>2025-12-31 00:59:22 -0500
commitb9f3f1731b2ccbef7547cfba61bc1cd697b00e61 (patch)
treeb19125e6515cac528aa93bcd46677cbd089fb39a /tnslc/compile/function.tnsl
parentc998a37b330fdb4296007dffc579fe4909583ef7 (diff)
fix var loc generationorigin
Diffstat (limited to 'tnslc/compile/function.tnsl')
-rw-r--r--tnslc/compile/function.tnsl9
1 files changed, 7 insertions, 2 deletions
diff --git a/tnslc/compile/function.tnsl b/tnslc/compile/function.tnsl
index 8b5b480..c47040f 100644
--- a/tnslc/compile/function.tnsl
+++ b/tnslc/compile/function.tnsl
@@ -235,11 +235,14 @@ struct Function {
;/
;/
+ /; _return (~Scope s, ~parse.Node n)
+ ;/
+
# Should handle break, continue, and return
/; _compile_flow_control (~Scope s, ~parse.Node n)
/; if (utils.strcmp(n`.data, "return\0") == true)
# Compute value and return
- self._compile_value(s, n)
+ self._return(s, n)
;; else if (utils.strcmp(n`.data, "continue\0") == true)
~Scope lp = s`.closest_loop()
/; if (lp == NULL)
@@ -270,7 +273,9 @@ struct Function {
;/
# Should handle computing a value, delegate to other funcs when needed
- /; _compile_value (~Scope s, ~parse.Node n)
+ /; _compile_value (~Scope s, ~parse.Node n) [Var]
+ Var out
+ return out
;/
/; _print (int idt)