Compare commits
1 Commits
da6e306fad
...
6231c6b279
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6231c6b279 |
@ -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))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user