(metadata)
| 722 | |
| 723 | |
| 724 | def create_asm_consts(metadata): |
| 725 | asm_consts = {} |
| 726 | for addr, const in metadata.em_asm_consts.items(): |
| 727 | body = trim_asm_const_body(const) |
| 728 | max_arity = 16 |
| 729 | arity = 0 |
| 730 | for i in range(max_arity): |
| 731 | if f'${i}' in const: |
| 732 | arity = i + 1 |
| 733 | args = ', '.join(f'${i}' for i in range(arity)) |
| 734 | if 'arguments' in body: |
| 735 | # arrow functions don't bind `arguments` so we have to use |
| 736 | # the old function syntax in this case |
| 737 | func = f'function({args}) {{ {body} }}' |
| 738 | else: |
| 739 | func = f'({args}) => {{ {body} }}' |
| 740 | asm_consts[addr] = func |
| 741 | asm_consts = sorted(asm_consts.items()) |
| 742 | return asm_consts |
| 743 | |
| 744 | |
| 745 | def type_to_sig(type): |
no test coverage detected