From 75c5c7ccdf258d1f4731b02b6291ce55a04ea709 Mon Sep 17 00:00:00 2001 From: Kai Gunger Date: Sun, 28 Dec 2025 01:52:42 -0500 Subject: pre-check funcs (stub) --- tnslc/compile/scope.tnsl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'tnslc/compile/scope.tnsl') diff --git a/tnslc/compile/scope.tnsl b/tnslc/compile/scope.tnsl index 9079e60..b4fd4f3 100644 --- a/tnslc/compile/scope.tnsl +++ b/tnslc/compile/scope.tnsl @@ -105,6 +105,39 @@ struct Scope { return out ;/ + /; mk_aware (~Var v) + Var mk = v`.copy() + mk.offset = 0 + + /; if (mk.loc > 0) + mk.loc = 1 + ;/ + + self.vars.push(~mk) + ;/ + + /; mk_aware_node (~parse.Node n) + ;/ + + /; precheck_stmt (~parse.Node n) + ;/ + + /; find_var (~uint8 name) [~Var] + ~Var v + /; loop (int i = 0; i < self.vars.count) [i++] + v = self.vars.get(i) + /; if (utils.strcmp(v`.name, name) == true) + return v + ;/ + ;/ + + /; if (self.parent !== NULL) + return self.parent`.find_var(name) + ;/ + + return NULL + ;/ + /; mk_set_var (~Var src) Var out = src`.copy() -- cgit v1.2.3