binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

wasm-as should accept empty `then`

Open zapashcanon opened this issue 2 years ago • 2 comments

Hi,

The following code is rejected by wasm-as:

(module
  (func $f (export "f") (param $n i32)
    (if (local.get $n) (then))
  )
)
$ wasm-as tmp.wast
[parse exception: expected more elements in list (at 3:23)]Fatal: error in parsing input

It's actually valid and accepted by the reference interpreter.

zapashcanon avatar Jan 15 '23 03:01 zapashcanon

We're working on a new text parser that will handle this correctly.

tlively avatar Jan 17 '23 16:01 tlively

Looks like this has been resolved in 1d95fdc7805ef2f29b8b8b0cce8f7c8cc385edd0

patrick96 avatar Oct 03 '23 17:10 patrick96