summaryrefslogtreecommitdiff
path: root/tnslc/compile/scope.tnsl
diff options
context:
space:
mode:
authorKai Gunger <kgunger12@gmail.com>2026-05-19 00:13:35 -0400
committerKai Gunger <kgunger12@gmail.com>2026-05-19 00:13:35 -0400
commit20b9f5a8418670665ff5c5d3f5de538d35ec161b (patch)
tree60f842db35e68ebcb8134f1e26fa6b261494806a /tnslc/compile/scope.tnsl
parent6a605be056216c5979561eb51f723f84e9f0c6d0 (diff)
[tnslc] various updatesdevel
Diffstat (limited to 'tnslc/compile/scope.tnsl')
-rw-r--r--tnslc/compile/scope.tnsl15
1 files changed, 15 insertions, 0 deletions
diff --git a/tnslc/compile/scope.tnsl b/tnslc/compile/scope.tnsl
index 569c48a..35f6b8b 100644
--- a/tnslc/compile/scope.tnsl
+++ b/tnslc/compile/scope.tnsl
@@ -639,6 +639,7 @@ struct Scope {
return out
;/
+
# Get closest breakable scope
/; _closest_break [~Scope]
/; if (utils.ends_with(self.name, "#wrap\0"))
@@ -748,5 +749,19 @@ struct Scope {
self.cb`.add_c(":\n\0")
_delete(el)
;/
+
+ /; gen_const_name [~uint8]
+ utils.Vector v = self._base_label()
+
+ ~uint8 u = utils.int_to_str(self.unique)
+ v.push_char('#')
+ v.push_cstr(u)
+ v.push_cstr("#const\0")
+ _delete(u)
+
+ self.unique++
+
+ return v.as_cstr()
+ ;/
;/