Compare commits

..

1 Commits

Author SHA1 Message Date
Johan B.W. de Vries
6231c6b279 Tuple instantiation works again
Typing is getting ugly again
2023-01-01 16:00:18 +01:00

View File

@ -155,9 +155,6 @@ F64_OPERATOR_MAP = {
} }
def tuple_instantiation(wgn: WasmGenerator, inp: ourlang.TupleInstantiation) -> None: def tuple_instantiation(wgn: WasmGenerator, inp: ourlang.TupleInstantiation) -> None:
"""
Compile: Instantiation (allocation) of a tuple
"""
assert isinstance(inp.type3, type3types.AppliedType3) assert isinstance(inp.type3, type3types.AppliedType3)
assert inp.type3.base is type3types.tuple assert inp.type3.base is type3types.tuple
assert len(inp.elements) == len(inp.type3.args) assert len(inp.elements) == len(inp.type3.args)
@ -168,7 +165,7 @@ def tuple_instantiation(wgn: WasmGenerator, inp: ourlang.TupleInstantiation) ->
comment_elements += f'{element.type3.name}, ' comment_elements += f'{element.type3.name}, '
tmp_var = wgn.temp_var_i32('tuple_adr') tmp_var = wgn.temp_var_i32('tuple_adr')
wgn.add_statement('nop', comment=f'{tmp_var.name} := ({comment_elements})') wgn.add_statement('nop', comment=f'tmp_var := ({comment_elements})')
# Allocated the required amounts of bytes in memory # Allocated the required amounts of bytes in memory
wgn.i32.const(_calculate_alloc_size(inp.type3)) wgn.i32.const(_calculate_alloc_size(inp.type3))