something's screwed up with im im handling string variables :/
This commit is contained in:
@@ -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) + "]"
|
||||
|
Reference in New Issue
Block a user