diff --git a/README.md b/README.md index fd43c06..d777fb8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## Status * Lexer: supports nested block comments and all lexemes from Spec - * Parser: parses all examples from WebAssembly Core TestsSuit + * Parser: parses all examples from WebAssembly Core TestsSuit(including folded instructions parsing) ## ToDo * Improve error messages for text representation parsing diff --git a/src/Language/Wasm/Parser.y b/src/Language/Wasm/Parser.y index 3cf53b3..8d1f7c9 100644 --- a/src/Language/Wasm/Parser.y +++ b/src/Language/Wasm/Parser.y @@ -619,18 +619,10 @@ export_import_typeuse_locals_body1 :: { [ModuleField] } : 'export' name ')' export_import_typeuse_locals_body { (MFExport $ Export $2 $ ExportFunc Nothing) : $4 } | import_typeuse_locals_body1 { [$1] } -import_typeuse_locals_body :: { ModuleField } - : '(' import_typeuse_locals_body1 { $2 } - | ')' { MFFunc $ Function Nothing (AnonimousTypeUse $ FuncType [] []) [] [] } - import_typeuse_locals_body1 :: { ModuleField } : 'import' name name ')' typeuse ')' { MFImport $ Import $2 $3 $ ImportFunc Nothing $5 } | typeuse_locals_body1 { MFFunc $ Function Nothing (t3fst $1) (t3snd $1) (t3thd $1) } -typeuse_locals_body :: { (TypeUse, [LocalType], [Instruction]) } - : '(' typeuse_locals_body1 { $2 } - | ')' { (AnonimousTypeUse $ FuncType [] [], [], []) } - typeuse_locals_body1 :: { (TypeUse, [LocalType], [Instruction]) } : 'type' typeidx ')' signature_locals_body { (IndexedTypeUse $2 (t3fst $4), t3snd $4, t3thd $4) } | signature_locals_body1 { (AnonimousTypeUse (fromMaybe emptyFuncType $ t3fst $1), t3snd $1, t3thd $1) }