Open Abhiroop opened 1 year ago
The current production rule for elem segments is here - https://github.com/SPY/haskell-wasm/blob/master/src/Language/Wasm/Parser.y#L911 It definitely won't parse the example that I gave. I am not at all familiar with Happy
but a production rule that parses this is something like this:
'elem' opt(ident) '(' offsetexpr 'func' index ')' { ElemSegment (Index 0) $4 [$6] }
Someone who understands the wast
grammar well should comment if this looks reasonable. The parser seems happy with this but I might have changed the meaning of the grammar.
When parsing valid
wast
files, the parser currently is unable to parse wast files containing this variant of the elem segment string:Currently, this throws the following error:
I presume the error lies somewhere in Parser.y. The reference interpreter is able to parse this file fine.