diff --git a/Cargo.toml b/Cargo.toml index 6d7432a..c5fef18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ criterion = "0.3" diff = "0.1" rand = "0.8" wat = "1" -wasmparser = "0.82" +wasmparser = "0.84" wasmprinter = "0.2" [features] diff --git a/tests/expectations/gas/branch.wat b/tests/expectations/gas/branch.wat index b314e32..8a733f2 100644 --- a/tests/expectations/gas/branch.wat +++ b/tests/expectations/gas/branch.wat @@ -26,4 +26,6 @@ i32.add local.set 1 end - local.get 1)) \ No newline at end of file + local.get 1 + ) +) \ No newline at end of file diff --git a/tests/expectations/gas/call.wat b/tests/expectations/gas/call.wat index a02e9df..dd8f6e3 100644 --- a/tests/expectations/gas/call.wat +++ b/tests/expectations/gas/call.wat @@ -10,10 +10,13 @@ local.get $y call 2 local.set 2 - local.get 2) + local.get 2 + ) (func (;2;) (type 0) (param i32 i32) (result i32) i32.const 3 call $add_locals local.get 0 local.get 1 - i32.add)) \ No newline at end of file + i32.add + ) +) \ No newline at end of file diff --git a/tests/expectations/gas/ifs.wat b/tests/expectations/gas/ifs.wat index 163db76..5f23c27 100644 --- a/tests/expectations/gas/ifs.wat +++ b/tests/expectations/gas/ifs.wat @@ -17,4 +17,6 @@ call 0 local.get 0 i32.popcnt - end)) \ No newline at end of file + end + ) +) \ No newline at end of file diff --git a/tests/expectations/gas/simple.wat b/tests/expectations/gas/simple.wat index f7b7755..d742951 100644 --- a/tests/expectations/gas/simple.wat +++ b/tests/expectations/gas/simple.wat @@ -15,10 +15,13 @@ i32.const 123 drop end - end) + end + ) (func (;2;) (type 0) i32.const 1 call 0 block ;; label = @1 - end) - (export "simple" (func 1))) \ No newline at end of file + end + ) + (export "simple" (func 1)) +) \ No newline at end of file diff --git a/tests/expectations/gas/start.wat b/tests/expectations/gas/start.wat index db51c26..cd3b7cd 100644 --- a/tests/expectations/gas/start.wat +++ b/tests/expectations/gas/start.wat @@ -11,8 +11,10 @@ i32.const 8 i32.const 4 call $ext_return - unreachable) + unreachable + ) (func (;3;) (type 1)) (export "call" (func 3)) (start 2) - (data (;0;) (i32.const 8) "\01\02\03\04")) \ No newline at end of file + (data (;0;) (i32.const 8) "\01\02\03\04") +) \ No newline at end of file diff --git a/tests/expectations/stack-height/empty_functions.wat b/tests/expectations/stack-height/empty_functions.wat index 63642ed..a32b02c 100644 --- a/tests/expectations/stack-height/empty_functions.wat +++ b/tests/expectations/stack-height/empty_functions.wat @@ -15,7 +15,8 @@ global.get 0 i32.const 2 i32.sub - global.set 0) + global.set 0 + ) (func (;1;) (type 0) global.get 0 i32.const 2 @@ -31,7 +32,8 @@ global.get 0 i32.const 2 i32.sub - global.set 0) + global.set 0 + ) (func (;2;) (type 0) global.get 0 i32.const 2 @@ -47,6 +49,8 @@ global.get 0 i32.const 2 i32.sub - global.set 0) + global.set 0 + ) (global (;0;) (mut i32) i32.const 0) - (export "main" (func 2))) \ No newline at end of file + (export "main" (func 2)) +) \ No newline at end of file diff --git a/tests/expectations/stack-height/global.wat b/tests/expectations/stack-height/global.wat index a14d625..cba8282 100644 --- a/tests/expectations/stack-height/global.wat +++ b/tests/expectations/stack-height/global.wat @@ -6,7 +6,8 @@ (func $i32.add (type 1) (param i32 i32) (result i32) local.get 0 local.get 1 - i32.add) + i32.add + ) (func (;2;) (type 2) (param $arg i32) (local $tmp i32) global.get $counter @@ -31,7 +32,8 @@ i32.const 4 i32.sub global.set 1 - drop) + drop + ) (func (;3;) (type 1) (param i32 i32) (result i32) local.get 0 local.get 1 @@ -49,7 +51,9 @@ global.get 1 i32.const 4 i32.sub - global.set 1) + global.set 1 + ) (global $counter (mut i32) i32.const 1) (global (;1;) (mut i32) i32.const 0) - (export "i32.add" (func 3))) \ No newline at end of file + (export "i32.add" (func 3)) +) \ No newline at end of file diff --git a/tests/expectations/stack-height/imports.wat b/tests/expectations/stack-height/imports.wat index c945ce2..79178ce 100644 --- a/tests/expectations/stack-height/imports.wat +++ b/tests/expectations/stack-height/imports.wat @@ -8,7 +8,8 @@ call $boo local.get 0 local.get 1 - i32.add) + i32.add + ) (func (;3;) (type 1) (param i32 i32) (result i32) local.get 0 local.get 1 @@ -26,6 +27,8 @@ global.get 0 i32.const 4 i32.sub - global.set 0) + global.set 0 + ) (global (;0;) (mut i32) i32.const 0) - (export "i32.add" (func 3))) \ No newline at end of file + (export "i32.add" (func 3)) +) \ No newline at end of file diff --git a/tests/expectations/stack-height/many_locals.wat b/tests/expectations/stack-height/many_locals.wat index 941a0e7..76c1f2c 100644 --- a/tests/expectations/stack-height/many_locals.wat +++ b/tests/expectations/stack-height/many_locals.wat @@ -1,7 +1,8 @@ (module (type (;0;) (func)) (func $one-group-many-locals (type 0) - (local i64 i64 i32)) + (local i64 i64 i32) + ) (func $main (type 0) global.get 0 i32.const 5 @@ -17,5 +18,7 @@ global.get 0 i32.const 5 i32.sub - global.set 0) - (global (;0;) (mut i32) i32.const 0)) \ No newline at end of file + global.set 0 + ) + (global (;0;) (mut i32) i32.const 0) +) \ No newline at end of file diff --git a/tests/expectations/stack-height/simple.wat b/tests/expectations/stack-height/simple.wat index 0e8c54c..4f83649 100644 --- a/tests/expectations/stack-height/simple.wat +++ b/tests/expectations/stack-height/simple.wat @@ -2,7 +2,8 @@ (type (;0;) (func)) (func (;0;) (type 0) i32.const 123 - drop) + drop + ) (func (;1;) (type 0) global.get 0 i32.const 3 @@ -18,6 +19,8 @@ global.get 0 i32.const 3 i32.sub - global.set 0) + global.set 0 + ) (global (;0;) (mut i32) i32.const 0) - (export "simple" (func 1))) \ No newline at end of file + (export "simple" (func 1)) +) \ No newline at end of file diff --git a/tests/expectations/stack-height/start.wat b/tests/expectations/stack-height/start.wat index 780d5d9..037dcc8 100644 --- a/tests/expectations/stack-height/start.wat +++ b/tests/expectations/stack-height/start.wat @@ -4,7 +4,8 @@ (import "env" "ext_return" (func $ext_return (type 0))) (import "env" "memory" (memory (;0;) 1 1)) (func $start (type 1) - (local i32)) + (local i32) + ) (func (;2;) (type 1)) (func (;3;) (type 1) global.get 0 @@ -21,7 +22,8 @@ global.get 0 i32.const 3 i32.sub - global.set 0) + global.set 0 + ) (func (;4;) (type 1) global.get 0 i32.const 2 @@ -37,7 +39,9 @@ global.get 0 i32.const 2 i32.sub - global.set 0) + global.set 0 + ) (global (;0;) (mut i32) i32.const 0) (export "call" (func 4)) - (start 3)) \ No newline at end of file + (start 3) +) \ No newline at end of file diff --git a/tests/expectations/stack-height/table.wat b/tests/expectations/stack-height/table.wat index d81303e..23477d3 100644 --- a/tests/expectations/stack-height/table.wat +++ b/tests/expectations/stack-height/table.wat @@ -21,11 +21,13 @@ i32.const 4 i32.sub global.set 0 - drop) + drop + ) (func $i32.add (type 2) (param i32 i32) (result i32) local.get 0 local.get 1 - i32.add) + i32.add + ) (func (;3;) (type 1) (param i32) local.get 0 global.get 0 @@ -42,7 +44,8 @@ global.get 0 i32.const 4 i32.sub - global.set 0) + global.set 0 + ) (func (;4;) (type 2) (param i32 i32) (result i32) local.get 0 local.get 1 @@ -60,8 +63,10 @@ global.get 0 i32.const 4 i32.sub - global.set 0) + global.set 0 + ) (table (;0;) 10 funcref) (global (;0;) (mut i32) i32.const 0) (export "i32.add" (func 4)) - (elem (;0;) (i32.const 0) func $foo 3 4)) \ No newline at end of file + (elem (;0;) (i32.const 0) func $foo 3 4) +) \ No newline at end of file