@@ -306,35 +306,6 @@ def call_function(*args):
306306 SS .append (t )
307307 program_block .forward ()
308308
309- # def call_function(*args):
310- # if SS[len(SS) - 1] == 'output':
311- # return
312- # function_attributes = []
313- # for j in range(len(SS) - 1, -1, -1):
314- # if isinstance(SS[j], list):
315- # function_attributes = SS[j]
316- # input_size = len(function_attributes) - 3
317- # # assign function inputs
318- # for j in range(input_size):
319- # program_block.add_instruction(program_block.i, 'ASSIGN', SS[len(SS) - input_size + j], function_attributes[j + 1])
320- # program_block.forward()
321- # # assign return address
322- # program_block.add_instruction(program_block.i, 'ASSIGN', f'#{program_block.i + 2}', function_attributes[input_size + 1])
323- # program_block.forward()
324- # # go to function
325- # program_block.add_instruction(program_block.i, 'JP', function_attributes[0] + 1)
326- # program_block.forward()
327- # for j in range(input_size + 1):
328- # SS.pop()
329- # # create a new variable and assign function output to it
330- # address = memory.get_temp_address()
331- # SS.append(address)
332- # program_block.add_instruction(program_block.i, 'ASSIGN', function_attributes[input_size + 2], address)
333- # program_block.forward()
334-
335- # def access_array_index(*args):
336- # pass
337-
338309def assign_array_index (* args ):
339310 index = SS .pop ()
340311 address = SS .pop ()
0 commit comments