Skip to content

Interpreter: Inconsistencies in s-expression format #437

@jonas-db

Description

@jonas-db

In the example 'simple' (https://cdn.rawgit.com/WebAssembly/wabt/e528a622caa77702209bf0c3654ca78456c41a52/demo/index.html) there is a prefix notation of operators:

(module
  (func $addTwo (param i32 i32) (result i32)
    (i32.add
      (get_local 0)
      (get_local 1)))
  (export "addTwo" (func $addTwo)))

However, when i convert a .wasm to a .wast with wasm -d module.wasm -o module.wast, i see code snippets where this is not the case:

      (get_local 0)
      (i32.const 44)
      (i32.add)

This makes parsing such s-based expressions hard since i32.add is expected to have 2 operands. This is also the case with other operators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions