something's screwed up with im im handling string variables :/

This commit is contained in:
SpookyDervish
2025-09-06 20:54:17 +10:00
parent 459f53a4e1
commit 85331b4067
7 changed files with 199 additions and 18 deletions

View File

@@ -13,10 +13,10 @@ class Generator:
self.constants_reverse = {}
self.constant_counter = 0
def add_constant(self, value: Any):
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}]"
self.constants["LC" + str(self.constant_counter)] = value
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) + "]"