IT WORKSSSS, WE'RE ACCESSING THE ARGS!!!!!

This commit is contained in:
SpookyDervish
2025-09-10 20:25:19 +10:00
parent 523ccecbc0
commit a23bcf7823
5 changed files with 101 additions and 62 deletions

View File

@@ -31,7 +31,7 @@ class Generator:
self.current_var_scope = self.global_scope
self.constants = {}
self.structs = {}
self.functions: dict[str, FunctionNode] = {}
self.functions: dict[str, dict] = {}
self.labels = []
self.arg_list = []
self.constants_reverse = {}
@@ -58,7 +58,11 @@ class Generator:
return "[.LC" + str(self.constant_counter-1) + "]"
def add_function(self, node: FunctionNode):
self.functions[node.name] = node
self.functions[node.name] = {
"func": node,
"scope": SymbolTable(self.current_var_scope)
}
return self.functions[node.name]
def clamp_instruction_args(self, instruction: InstructionNode, min_args: int, max_args: int):
if len(instruction.arguments) < min_args: