wasm_sections := wasm.parse_sections(^wasm_binary, context.allocator);
defer wasm.free_sections(^wasm_sections);
- printf("Types:\n{p}\n", wasm_sections.type_section);
- printf("Imports:\n{p}\n", wasm_sections.import_section);
- printf("Exports:\n{p}\n", wasm_sections.export_section);
+
+ i := 0;
+ for ^code: wasm_sections.code_section {
+ i += 1;
+ printf("Function {}\n", i);
+ for instr: wasm.instruction_iterator(^wasm_binary, code) {
+ printf("{}\n", instr);
+ }
+ print("\n");
+ }
+
+
// printf("Code:\n{}\n", wasm_sections.code_section);
// type_section := wasm.parse_type_section(^wasm_binary);