webassemblyjs icon indicating copy to clipboard operation
webassemblyjs copied to clipboard

wast-parser remove extra generate names

Open xtuc opened this issue 7 years ago • 0 comments

(module
  (global (export "v") i32 (i32.const 1))
)

and the corresponding AST is:

(module
  (global $global_0 i32 (i32.const 1))
  (export "v" (global $global_0)) 
)

The issues:

  • the global declaration has no name and we are assuming they were
  • doesn't match with the wasm-parser (which uses an offset)

I would propose to introduce indices in the state of the parser and change the identifiers with numberLitertals.

TODO: test to re-activate: https://github.com/xtuc/webassemblyjs/blob/0998ea34c48bb4f41ec9e0b2e903005af0632c94/packages/wasm-parser/test/fixtures/module-export/global/actual.wat-failure

xtuc avatar May 28 '18 08:05 xtuc