From 4c8a71de160da47b51cf380dd4322545bb10e058 Mon Sep 17 00:00:00 2001 From: Ilya Rezvov Date: Fri, 23 Feb 2018 16:40:40 -0800 Subject: [PATCH] reduce shift/reduce conflicts --- src/Language/Wasm/Parser.y | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Language/Wasm/Parser.y b/src/Language/Wasm/Parser.y index 912b771..7eaad2b 100644 --- a/src/Language/Wasm/Parser.y +++ b/src/Language/Wasm/Parser.y @@ -578,7 +578,6 @@ instruction :: { [Instruction] } : raw_instr { $1 } | foldedinstr { $1 } --- TODO: handle call_direct call properly, now it tries to consume ')' raw_instr :: { [Instruction] } : plaininstr { [PlainInstr $1] } | 'call_indirect' raw_call_indirect { $2 } @@ -653,7 +652,7 @@ raw_call_indirect_functype1 :: { (Maybe FuncType, [Instruction]) } : paramsresulttypeuse raw_call_indirect_functype { (Just $ mergeFuncType $1 $ fromMaybe emptyFuncType $ fst $2, snd $2) } - | foldedinstr1 list(instruction) { (Nothing, $1 ++ concat $2) } + | foldedinstr1 { (Nothing, $1) } foldedinstr :: { [Instruction] } : '(' foldedinstr1 { $2 }