fixing quite a few bugs

This commit is contained in:
SpookyDervish
2025-09-13 07:08:11 +10:00
parent 170272353c
commit 86d59a8177
7 changed files with 70 additions and 19 deletions

View File

@@ -52,11 +52,11 @@ class Generator:
def add_constant(self, value: Any, no_string: bool = False):
existing_constant_name = self.constants_reverse.get(value, None)
if existing_constant_name != None: return f"[.{existing_constant_name}]"
if existing_constant_name != None: return f"[{existing_constant_name}]"
self.constants["LC" + str(self.constant_counter)] = {"value": value, "no_string": no_string}
self.constants_reverse[value] = "LC" + str(self.constant_counter)
self.constant_counter += 1
return "[.LC" + str(self.constant_counter-1) + "]"
return "[LC" + str(self.constant_counter-1) + "]"
def add_function(self, node: FunctionNode):
self.functions[node.name] = {