Module Wax_wasm.FoldingSource

Folded/Unfolded instruction conversion.

fold d modul converts unfolded instructions (like i32.add) into folded S-expressions (like (i32.add ...)) where possible in the module. Folding is arity-driven and resolves names per conditional branch, so it needs the located AST (to model branch conditions). Because it runs on input that is not validated first (an unvalidated wat->wat conversion or a trusted wasm->wat binary), an unbound index — or one that resolves to the wrong kind of definition — is reported to d rather than raising.

Sourceval unfold : 'info Ast.Text.module_ -> 'info Ast.Text.module_

unfold modul flattens folded S-expressions into linear instruction sequences in the module.