diff --git a/src/Language/Wasm/Lexer.x b/src/Language/Wasm/Lexer.x index 92f696b..f201d30 100644 --- a/src/Language/Wasm/Lexer.x +++ b/src/Language/Wasm/Lexer.x @@ -33,8 +33,8 @@ $doublequote = \" @linecomment = ";;" $linechar* \x0A @startblockcomment = "(;" @endblockcomment = ";)" -@num = $digit (\_? $digit*) -@hexnum = $hexdigit (\_? $hexdigit*) +@num = $digit (\_? $digit*)* +@hexnum = $hexdigit (\_? $hexdigit*)* @id = "$" $idchar+ @floatfrac = @num "." (@num)? @exp = [Ee] $sign? @num diff --git a/src/Language/Wasm/Parser.y b/src/Language/Wasm/Parser.y index a5aa6bd..9bf7f27 100644 --- a/src/Language/Wasm/Parser.y +++ b/src/Language/Wasm/Parser.y @@ -960,7 +960,7 @@ start :: { StartFunction } -- but collection of testcases omits 'offset' in this position -- I am going to support both options for now, but maybe it has to be updated in future. offsetexpr :: { [Instruction] } - : 'offset' foldedinstr ')' { $2 } + : 'offset' list(foldedinstr) ')' { concat $2 } | foldedinstr1 { $1 } elemsegment :: { ElemSegment }