when I try to use the wat2wasm file.wat command into a simple example like this, it gives me error.
(module
(func $add (param $lhs i32) (param $rhs i32) (result i32)
get_local $lhs
get_local $rhs
i32.add)
(export "add" (func $add))
)
This is the error:
add1.wat:3:5: error: unexpected token get_local, expected ).
get_local $lhs
^^^^^^^^^
add1.wat:4:5: error: unexpected token get_local.
get_local $rhs
wat2wasm add.wat cmd should run successfully. use one of the wabt tools to generate a wasm module from it
get_local
token statement line has to be inside a separate parenthesis, like this:
(module
(func $add (param $lhs i32) (param $rhs i32) (result i32)
(local.get $lhs)
(local.get $rhs)
(i32.add)
)
(export "add" (func $add))
)