├── .gitignore ├── LICENSE ├── README.md ├── build.gradle.kts ├── developer_environment.md ├── gradle.properties ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle.kts └── src ├── main ├── gen │ └── org │ │ └── jetbrains │ │ └── webstorm │ │ └── lang │ │ ├── lexer │ │ ├── _WebAssemblyLexer.flex │ │ └── _WebAssemblyLexer.java │ │ ├── parser │ │ ├── WebAssemblyParser.java │ │ └── WebAssemblyParserUtil.java │ │ └── psi │ │ ├── WebAssemblyAligneq.java │ │ ├── WebAssemblyBlockinstr.java │ │ ├── WebAssemblyBlocktype.java │ │ ├── WebAssemblyCallIndirectInstr.java │ │ ├── WebAssemblyCallInstr.java │ │ ├── WebAssemblyComment.java │ │ ├── WebAssemblyData.java │ │ ├── WebAssemblyElem.java │ │ ├── WebAssemblyElemDropInstr.java │ │ ├── WebAssemblyElemlist.java │ │ ├── WebAssemblyExport.java │ │ ├── WebAssemblyExportdesc.java │ │ ├── WebAssemblyFoldeinstr.java │ │ ├── WebAssemblyFunc.java │ │ ├── WebAssemblyFunctype.java │ │ ├── WebAssemblyGlobal.java │ │ ├── WebAssemblyGlobalInstr.java │ │ ├── WebAssemblyGlobaltype.java │ │ ├── WebAssemblyIdx.java │ │ ├── WebAssemblyImport.java │ │ ├── WebAssemblyImportdesc.java │ │ ├── WebAssemblyInlineData.java │ │ ├── WebAssemblyInlineElem.java │ │ ├── WebAssemblyInlineExport.java │ │ ├── WebAssemblyInlineImport.java │ │ ├── WebAssemblyInstr.java │ │ ├── WebAssemblyLexerTokens.java │ │ ├── WebAssemblyLocal.java │ │ ├── WebAssemblyLocalInstr.java │ │ ├── WebAssemblyMem.java │ │ ├── WebAssemblyMemoryIdxInstr.java │ │ ├── WebAssemblyMemtype.java │ │ ├── WebAssemblyModule.java │ │ ├── WebAssemblyModulefield.java │ │ ├── WebAssemblyOffseteq.java │ │ ├── WebAssemblyParam.java │ │ ├── WebAssemblyPlaininstr.java │ │ ├── WebAssemblyRefFuncInstr.java │ │ ├── WebAssemblyResult.java │ │ ├── WebAssemblyStart.java │ │ ├── WebAssemblyTable.java │ │ ├── WebAssemblyTableCopyInstr.java │ │ ├── WebAssemblyTableIdxInstr.java │ │ ├── WebAssemblyTableInitInstr.java │ │ ├── WebAssemblyTabletype.java │ │ ├── WebAssemblyType.java │ │ ├── WebAssemblyTypes.java │ │ ├── WebAssemblyTypeuse.java │ │ ├── WebAssemblyTypeuseTyperef.java │ │ ├── WebAssemblyValtype.java │ │ ├── WebAssemblyVisitor.java │ │ └── impl │ │ ├── WebAssemblyAligneqImpl.java │ │ ├── WebAssemblyBlockinstrImpl.java │ │ ├── WebAssemblyBlocktypeImpl.java │ │ ├── WebAssemblyCallIndirectInstrImpl.java │ │ ├── WebAssemblyCallInstrImpl.java │ │ ├── WebAssemblyCommentImpl.java │ │ ├── WebAssemblyDataImpl.java │ │ ├── WebAssemblyElemDropInstrImpl.java │ │ ├── WebAssemblyElemImpl.java │ │ ├── WebAssemblyElemlistImpl.java │ │ ├── WebAssemblyExportImpl.java │ │ ├── WebAssemblyExportdescImpl.java │ │ ├── WebAssemblyFoldeinstrImpl.java │ │ ├── WebAssemblyFuncImpl.java │ │ ├── WebAssemblyFunctypeImpl.java │ │ ├── WebAssemblyGlobalImpl.java │ │ ├── WebAssemblyGlobalInstrImpl.java │ │ ├── WebAssemblyGlobaltypeImpl.java │ │ ├── WebAssemblyIdxImpl.java │ │ ├── WebAssemblyImportImpl.java │ │ ├── WebAssemblyImportdescImpl.java │ │ ├── WebAssemblyInlineDataImpl.java │ │ ├── WebAssemblyInlineElemImpl.java │ │ ├── WebAssemblyInlineExportImpl.java │ │ ├── WebAssemblyInlineImportImpl.java │ │ ├── WebAssemblyInstrImpl.java │ │ ├── WebAssemblyLexerTokensImpl.java │ │ ├── WebAssemblyLocalImpl.java │ │ ├── WebAssemblyLocalInstrImpl.java │ │ ├── WebAssemblyMemImpl.java │ │ ├── WebAssemblyMemoryIdxInstrImpl.java │ │ ├── WebAssemblyMemtypeImpl.java │ │ ├── WebAssemblyModuleImpl.java │ │ ├── WebAssemblyModulefieldImpl.java │ │ ├── WebAssemblyOffseteqImpl.java │ │ ├── WebAssemblyParamImpl.java │ │ ├── WebAssemblyPlaininstrImpl.java │ │ ├── WebAssemblyRefFuncInstrImpl.java │ │ ├── WebAssemblyResultImpl.java │ │ ├── WebAssemblyStartImpl.java │ │ ├── WebAssemblyTableCopyInstrImpl.java │ │ ├── WebAssemblyTableIdxInstrImpl.java │ │ ├── WebAssemblyTableImpl.java │ │ ├── WebAssemblyTableInitInstrImpl.java │ │ ├── WebAssemblyTabletypeImpl.java │ │ ├── WebAssemblyTypeImpl.java │ │ ├── WebAssemblyTypeuseImpl.java │ │ ├── WebAssemblyTypeuseTyperefImpl.java │ │ └── WebAssemblyValtypeImpl.java ├── grammars │ ├── WebAssemblyLexer.flex │ └── WebAssemblyParser.bnf ├── kotlin │ └── org │ │ └── jetbrains │ │ └── webstorm │ │ ├── ide │ │ ├── WebAssemblyBraceMatcher.kt │ │ ├── WebAssemblySyntaxHighlighter.kt │ │ ├── WebAssemblypSyntaxHighlighterFactory.kt │ │ ├── colors │ │ │ ├── WebAssemblyColor.kt │ │ │ └── WebAssemblyColorSettingPage.kt │ │ └── icons │ │ │ └── WebAssemblyIcons.kt │ │ └── lang │ │ ├── WebAssemblyCommenter.kt │ │ ├── WebAssemblyFoldingBuilder.kt │ │ ├── WebAssemblyKeywordCompletionContributor.kt │ │ ├── WebAssemblyKeywordCompletionProvider.kt │ │ ├── WebAssemblyLanguage.kt │ │ ├── WebAssemblyReference.kt │ │ ├── WebAssemblyUtil.kt │ │ ├── lexer │ │ └── WebAssemblyLexer.kt │ │ ├── parser │ │ └── WebAssemblyParserDefinition.kt │ │ └── psi │ │ ├── ElementTypes.kt │ │ ├── WebAssemblyElementFactory.kt │ │ ├── WebAssemblyFile.kt │ │ ├── WebAssemblyNamedElement.kt │ │ ├── WebAssemblyNamedReferencedElement.kt │ │ ├── WebAssemblyReferencedElement.kt │ │ └── impl │ │ ├── WebAssemblyNamedImportImpl.kt │ │ ├── WebAssemblyNamedReferencedElementImpl.kt │ │ └── WebAssemblyReferencedTableInitInstrImpl.kt └── resources │ ├── META-INF │ ├── plugin.xml │ └── pluginIcon.svg │ └── icons │ ├── webAssemblyFiletype.svg │ └── webAssemblyLogo.svg └── test ├── README.md ├── kotlin └── org │ └── jetbrains │ └── webstorm │ └── lang │ ├── editor │ ├── WebAssemblyCodeFoldingTest.kt │ └── WebAssemblyReferenceTest.kt │ └── parser │ ├── WebAssemblyTestBase.kt │ ├── WebAssemblyTestCommon.kt │ ├── WebAssemblyTestExpr.kt │ ├── WebAssemblyTestFile.kt │ ├── WebAssemblyTestFilePrevVersion.kt │ ├── WebAssemblyTestFunc.kt │ └── WebAssemblyTestModule.kt └── resources ├── editor ├── codeFolding │ ├── Br.wat │ ├── BrLoop.wat │ ├── BrifNamed.wat │ ├── Brtable.wat │ ├── ExprBrif.wat │ ├── Highlighting.wat │ ├── If.wat │ ├── IfMultiNamed.wat │ ├── IfReturn.wat │ ├── IfThenBr.wat │ ├── IfThenBrNamed.wat │ ├── IfThenElseBr.wat │ ├── IfThenElseBrNamed.wat │ ├── Loop.wat │ └── LoopMultiNamed.wat └── reference │ ├── BulkMemoryDisabled.wat │ ├── BulkMemoryNamed.wat │ ├── Call.wat │ ├── ExportGlobal.wat │ ├── Highlighting.wat │ ├── LoopMultiNamed.wat │ ├── Memory.wat │ ├── ReferenceTypesCallIndirect.wat │ ├── ReferenceTypesNamed.wat │ └── WasmTable.wat └── parser ├── common ├── BadCrlf.txt ├── BadCrlf.wat ├── BadErrorLongLine.txt ├── BadErrorLongLine.wat ├── BadErrorLongToken.txt ├── BadErrorLongToken.wat ├── BadInputCommand.txt ├── BadInputCommand.wat ├── BadOutputCommand.txt ├── BadOutputCommand.wat ├── BadSingleSemicolon.txt ├── BadSingleSemicolon.wat ├── BadStringEof.txt ├── BadStringEof.wat ├── BadStringEscape.txt ├── BadStringEscape.wat ├── BadStringHexEscape.txt ├── BadStringHexEscape.wat ├── BadToplevel.txt ├── BadToplevel.wat ├── Basic.txt ├── Basic.wat ├── EmptyFile.txt ├── EmptyFile.wat ├── ExportMutableGlobal.txt ├── ExportMutableGlobal.wat ├── ForceColor.txt ├── ForceColor.wat ├── LineComment.txt ├── LineComment.wat ├── NestedComments.txt ├── NestedComments.wat ├── Stdin.txt ├── Stdin.wat ├── StringEscape.txt ├── StringEscape.wat ├── StringHex.txt └── StringHex.wat ├── expr ├── Atomic.txt ├── Atomic.wat ├── AtomicAlign.txt ├── AtomicAlign.wat ├── BadBrName.txt ├── BadBrName.wat ├── BadBrNoDepth.txt ├── BadBrNoDepth.wat ├── BadBrtableNoVars.txt ├── BadBrtableNoVars.wat ├── BadConstF32Trailing.txt ├── BadConstF32Trailing.wat ├── BadConstI32Garbage.txt ├── BadConstI32Garbage.wat ├── BadConstI32JustNegativeSign.txt ├── BadConstI32JustNegativeSign.wat ├── BadConstI32Trailing.txt ├── BadConstI32Trailing.wat ├── BadConstTypeI32InNonSimdConst.txt ├── BadConstTypeI32InNonSimdConst.wat ├── BadConvertFloatSign.txt ├── BadConvertFloatSign.wat ├── BadConvertIntNoSign.txt ├── BadConvertIntNoSign.wat ├── BadGetlocalName.txt ├── BadGetlocalName.wat ├── BadIfNoThen.txt ├── BadIfNoThen.wat ├── BadLoadAlign.txt ├── BadLoadAlign.wat ├── BadLoadAlignMisspelled.txt ├── BadLoadAlignMisspelled.wat ├── BadLoadAlignNegative.txt ├── BadLoadAlignNegative.wat ├── BadLoadFloatSign.txt ├── BadLoadFloatSign.wat ├── BadLoadOffsetNegative.txt ├── BadLoadOffsetNegative.wat ├── BadLoadType.txt ├── BadLoadType.wat ├── BadNop.txt ├── BadNop.wat ├── BadSetlocalName.txt ├── BadSetlocalName.wat ├── BadStoreAlign.txt ├── BadStoreAlign.wat ├── BadStoreFloatSign.txt ├── BadStoreFloatSign.wat ├── BadStoreOffsetNegative.txt ├── BadStoreOffsetNegative.wat ├── BadStoreType.txt ├── BadStoreType.wat ├── BadUnexpected.txt ├── BadUnexpected.wat ├── Binary.txt ├── Binary.wat ├── Block.txt ├── Block.wat ├── BlockMulti.txt ├── BlockMulti.wat ├── BlockMultiNamed.txt ├── BlockMultiNamed.wat ├── BlockNamed.txt ├── BlockNamed.wat ├── BlockReturn.txt ├── BlockReturn.wat ├── Br.txt ├── Br.wat ├── BrBlock.txt ├── BrBlock.wat ├── BrLoop.txt ├── BrLoop.wat ├── BrNamed.txt ├── BrNamed.wat ├── Brif.txt ├── Brif.wat ├── BrifNamed.txt ├── BrifNamed.wat ├── Brtable.txt ├── Brtable.wat ├── BrtableMulti.txt ├── BrtableMulti.wat ├── BrtableNamed.txt ├── BrtableNamed.wat ├── BulkMemoryDisabled.txt ├── BulkMemoryDisabled.wat ├── BulkMemoryNamed.txt ├── BulkMemoryNamed.wat ├── Call.txt ├── Call.wat ├── CallDefinedLater.txt ├── CallDefinedLater.wat ├── CallNamePrefix.txt ├── CallNamePrefix.wat ├── CallNamed.txt ├── CallNamed.wat ├── Callimport.txt ├── Callimport.wat ├── CallimportNamed.txt ├── CallimportNamed.wat ├── CallimportType.txt ├── CallimportType.wat ├── Callindirect.txt ├── Callindirect.wat ├── CallindirectNamed.txt ├── CallindirectNamed.wat ├── Cast.txt ├── Cast.wat ├── Compare.txt ├── Compare.wat ├── Const.txt ├── Const.wat ├── Convert.txt ├── Convert.wat ├── ConvertSat.txt ├── ConvertSat.wat ├── CurrentMemory.txt ├── CurrentMemory.wat ├── Drop.txt ├── Drop.wat ├── ExprBr.txt ├── ExprBr.wat ├── ExprBrif.txt ├── ExprBrif.wat ├── Getglobal.txt ├── Getglobal.wat ├── GetglobalNamed.txt ├── GetglobalNamed.wat ├── Getlocal.txt ├── Getlocal.wat ├── GetlocalIndexAfterParam.txt ├── GetlocalIndexAfterParam.wat ├── GetlocalIndexMixedNamedUnnamed.txt ├── GetlocalIndexMixedNamedUnnamed.wat ├── GetlocalNamed.txt ├── GetlocalNamed.wat ├── GetlocalParam.txt ├── GetlocalParam.wat ├── GetlocalParamNamed.txt ├── GetlocalParamNamed.wat ├── GrowMemory.txt ├── GrowMemory.wat ├── If.txt ├── If.wat ├── IfMulti.txt ├── IfMulti.wat ├── IfMultiNamed.txt ├── IfMultiNamed.wat ├── IfReturn.txt ├── IfReturn.wat ├── IfThenBr.txt ├── IfThenBr.wat ├── IfThenBrNamed.txt ├── IfThenBrNamed.wat ├── IfThenElse.txt ├── IfThenElse.wat ├── IfThenElseBr.txt ├── IfThenElseBr.wat ├── IfThenElseBrNamed.txt ├── IfThenElseBrNamed.wat ├── IfThenElseList.txt ├── IfThenElseList.wat ├── Load.txt ├── Load.wat ├── LoadAligned.txt ├── LoadAligned.wat ├── LoadOffset.txt ├── LoadOffset.wat ├── Loop.txt ├── Loop.wat ├── LoopMulti.txt ├── LoopMulti.wat ├── LoopMultiNamed.txt ├── LoopMultiNamed.wat ├── LoopNamed.txt ├── LoopNamed.wat ├── MemoryCopy.txt ├── MemoryCopy.wat ├── MemoryDrop.txt ├── MemoryDrop.wat ├── MemoryFill.txt ├── MemoryFill.wat ├── MemoryInit.txt ├── MemoryInit.wat ├── Nop.txt ├── Nop.wat ├── ReferenceTypes.txt ├── ReferenceTypes.wat ├── ReferenceTypesCallIndirect.txt ├── ReferenceTypesCallIndirect.wat ├── ReferenceTypesNamed.txt ├── ReferenceTypesNamed.wat ├── Return.txt ├── Return.wat ├── ReturnBlock.txt ├── ReturnBlock.wat ├── ReturnIf.txt ├── ReturnIf.wat ├── ReturnVoid.txt ├── ReturnVoid.wat ├── Select.txt ├── Select.wat ├── Setglobal.txt ├── Setglobal.wat ├── SetglobalNamed.txt ├── SetglobalNamed.wat ├── Setlocal.txt ├── Setlocal.wat ├── SetlocalIndexAfterParam.txt ├── SetlocalIndexAfterParam.wat ├── SetlocalIndexMixedNamedUnnamed.txt ├── SetlocalIndexMixedNamedUnnamed.wat ├── SetlocalNamed.txt ├── SetlocalNamed.wat ├── SetlocalParam.txt ├── SetlocalParam.wat ├── SetlocalParamNamed.txt ├── SetlocalParamNamed.wat ├── Store.txt ├── Store.wat ├── StoreAligned.txt ├── StoreAligned.wat ├── StoreOffset.txt ├── StoreOffset.wat ├── TableCopy.txt ├── TableCopy.wat ├── TableDrop.txt ├── TableDrop.wat ├── TableGet.txt ├── TableGet.wat ├── TableGrow.txt ├── TableGrow.wat ├── TableInit.txt ├── TableInit.wat ├── TableSet.txt ├── TableSet.wat ├── TeeLocal.txt ├── TeeLocal.wat ├── Unary.txt ├── Unary.wat ├── UnaryExtend.txt ├── UnaryExtend.wat ├── Unreachable.txt └── Unreachable.wat ├── file ├── Add.txt ├── Add.wat ├── Call.txt ├── Call.wat ├── Fail.txt ├── Fail.wat ├── Global.txt ├── Global.wat ├── Highlighting.txt ├── Highlighting.wat ├── Logger.txt ├── Logger.wat ├── Logger2.txt ├── Logger2.wat ├── Memory.txt ├── Memory.wat ├── Shared0.txt ├── Shared0.wat ├── Shared1.txt ├── Shared1.wat ├── Simple.txt ├── Simple.wat ├── Table.txt ├── Table.wat ├── Table2.txt ├── Table2.wat ├── WasmTable.txt └── WasmTable.wat ├── file_v1.0 ├── Add.txt ├── Add.wat ├── Shared0.txt ├── Shared0.wat ├── Shared1.txt ├── Shared1.wat ├── Table.txt ├── Table.wat ├── Table2.txt ├── Table2.wat ├── WasmTable.txt └── WasmTable.wat ├── func ├── BadFuncName.txt ├── BadFuncName.wat ├── BadLocalBinding.txt ├── BadLocalBinding.wat ├── BadLocalBindingNoType.txt ├── BadLocalBindingNoType.wat ├── BadLocalName.txt ├── BadLocalName.wat ├── BadLocalType.txt ├── BadLocalType.wat ├── BadLocalTypeList.txt ├── BadLocalTypeList.wat ├── BadParam.txt ├── BadParam.wat ├── BadParamBinding.txt ├── BadParamBinding.wat ├── BadParamName.txt ├── BadParamName.wat ├── BadParamTypeList.txt ├── BadParamTypeList.wat ├── BadResultType.txt ├── BadResultType.wat ├── FuncNamed.txt ├── FuncNamed.wat ├── Local.txt ├── Local.wat ├── LocalEmpty.txt ├── LocalEmpty.wat ├── LocalExnref.txt ├── LocalExnref.wat ├── LocalMulti.txt ├── LocalMulti.wat ├── NoSpace.txt ├── NoSpace.wat ├── ParamBinding.txt ├── ParamBinding.wat ├── ParamExnref.txt ├── ParamExnref.wat ├── ParamMulti.txt ├── ParamMulti.wat ├── ParamType1.txt ├── ParamType1.wat ├── ParamType2.txt ├── ParamType2.wat ├── Result.txt ├── Result.wat ├── ResultEmpty.txt ├── ResultEmpty.wat ├── ResultExnref.txt ├── ResultExnref.wat ├── ResultMulti.txt ├── ResultMulti.wat ├── Sig.txt ├── Sig.wat ├── SigMatch.txt └── SigMatch.wat ├── future_tests ├── assert │ ├── assert-after-module.txt │ ├── assert-return-arithmetic-nan.txt │ ├── assert-return-canonical-nan.txt │ ├── assertinvalid-binary-module.txt │ ├── assertinvalid.txt │ ├── assertmalformed.txt │ ├── assertreturn.txt │ ├── bad-assert-before-module.txt │ ├── bad-assertreturn-non-const.txt │ ├── bad-assertreturn-too-few.txt │ ├── bad-assertreturn-too-many.txt │ ├── bad-assertreturn-unknown-function.txt │ ├── bad-invoke-no-module.txt │ ├── bad-invoke-too-few.txt │ ├── bad-invoke-too-many.txt │ ├── bad-invoke-unknown-function.txt │ └── invoke.txt ├── common_rest │ ├── AllFeatures.txt │ ├── AllFeatures.wat │ ├── Annotations.txt │ ├── Annotations.wat │ ├── BadAnnotations.txt │ └── BadAnnotations.wat ├── expr_rest │ ├── AtomicDisabled.txt │ ├── AtomicDisabled.wat │ ├── BadConstV128I16x8Overflow.txt │ ├── BadConstV128I16x8Overflow.wat │ ├── BadConstV128I32x4Overflow.txt │ ├── BadConstV128I32x4Overflow.wat │ ├── BadConstV128I8x16Overflow.txt │ ├── BadConstV128I8x16Overflow.wat │ ├── BadConstV128NatOverflow.txt │ ├── BadConstV128NatOverflow.wat │ ├── BadConstV128TypeI32Expected.txt │ ├── BadConstV128TypeI32Expected.wat │ ├── BadSimdShuffleLaneIndexOverflow.txt │ ├── BadSimdShuffleLaneIndexOverflow.wat │ ├── BadSimdShuffleLaneIndexOverflow2.txt │ ├── BadSimdShuffleLaneIndexOverflow2.wat │ ├── BadSimdShuffleNatExpected.txt │ ├── BadSimdShuffleNatExpected.wat │ ├── BadSimdShuffleNotEnoughIndices.txt │ ├── BadSimdShuffleNotEnoughIndices.wat │ ├── BadTryMultipleCatch.txt │ ├── BadTryMultipleCatch.wat │ ├── BadTryNoCatch.txt │ ├── BadTryNoCatch.wat │ ├── BrOnExn.txt │ ├── BrOnExn.wat │ ├── Const.txt │ ├── Const.wat │ ├── Rethrow.txt │ ├── Rethrow.wat │ ├── Simd.txt │ ├── Simd.wat │ ├── TailCall.txt │ ├── TailCall.wat │ ├── TailCallDisabled.txt │ ├── TailCallDisabled.wat │ ├── TailCallNamed.txt │ ├── TailCallNamed.wat │ ├── Throw.txt │ ├── Throw.wat │ ├── Try.txt │ ├── Try.wat │ ├── TryMulti.txt │ ├── TryMulti.wat │ └── semantic │ │ ├── BadAtomicUnnaturalAlign.txt │ │ ├── BadAtomicUnnaturalAlign.wat │ │ ├── BadBinaryOneExpr.txt │ │ ├── BadBinaryOneExpr.wat │ │ ├── BadBlockEndLabel.txt │ │ ├── BadBlockEndLabel.wat │ │ ├── BadBlockMismatchLabel.txt │ │ ├── BadBlockMismatchLabel.wat │ │ ├── BadBrBadDepth.txt │ │ ├── BadBrBadDepth.wat │ │ ├── BadBrDefinedLater.txt │ │ ├── BadBrDefinedLater.wat │ │ ├── BadBrNameUndefined.txt │ │ ├── BadBrNameUndefined.wat │ │ ├── BadBrUndefined.txt │ │ ├── BadBrUndefined.wat │ │ ├── BadBrtableBadDepth.txt │ │ ├── BadBrtableBadDepth.wat │ │ ├── BadCompareOneExpr.txt │ │ ├── BadCompareOneExpr.wat │ │ ├── BadConstI32Overflow.txt │ │ ├── BadConstI32Overflow.wat │ │ ├── BadConstI32Underflow.txt │ │ ├── BadConstI32Underflow.wat │ │ ├── BadConstI64Overflow.txt │ │ ├── BadConstI64Overflow.wat │ │ ├── BadGetglobalNameUndefined.txt │ │ ├── BadGetglobalNameUndefined.wat │ │ ├── BadGetglobalUndefined.txt │ │ ├── BadGetglobalUndefined.wat │ │ ├── BadGetlocalNameUndefined.txt │ │ ├── BadGetlocalNameUndefined.wat │ │ ├── BadGetlocalUndefined.txt │ │ ├── BadGetlocalUndefined.wat │ │ ├── BadIfEndLabel.txt │ │ ├── BadIfEndLabel.wat │ │ ├── BadIfMismatchLabel.txt │ │ ├── BadIfMismatchLabel.wat │ │ ├── BadLoadAlignNotPot.txt │ │ ├── BadLoadAlignNotPot.wat │ │ ├── BadLoopEndLabel.txt │ │ ├── BadLoopEndLabel.wat │ │ ├── BadLoopMismatchLabel.txt │ │ ├── BadLoopMismatchLabel.wat │ │ ├── BadSetglobalNameUndefined.txt │ │ ├── BadSetglobalNameUndefined.wat │ │ ├── BadSetglobalUndefined.txt │ │ ├── BadSetglobalUndefined.wat │ │ ├── BadSetlocalNameUndefined.txt │ │ ├── BadSetlocalNameUndefined.wat │ │ ├── BadSetlocalNoValue.txt │ │ ├── BadSetlocalNoValue.wat │ │ ├── BadSetlocalUndefined.txt │ │ ├── BadSetlocalUndefined.wat │ │ ├── BadStoreAlignNotPot.txt │ │ ├── BadStoreAlignNotPot.wat │ │ ├── CallimportDefinedLater.txt │ │ └── CallimportDefinedLater.wat ├── func_rest │ └── semantic │ │ ├── BadLocalRedefinition.txt │ │ ├── BadLocalRedefinition.wat │ │ ├── BadParamRedefinition.txt │ │ ├── BadParamRedefinition.wat │ │ ├── BadSigParamTypeMismatch.txt │ │ ├── BadSigParamTypeMismatch.wat │ │ ├── BadSigParamsEmpty.txt │ │ ├── BadSigParamsEmpty.wat │ │ ├── BadSigResultTypeMismatch.txt │ │ ├── BadSigResultTypeMismatch.wat │ │ ├── BadSigResultTypeNotVoid.txt │ │ ├── BadSigResultTypeNotVoid.wat │ │ ├── BadSigResultTypeVoid.txt │ │ ├── BadSigResultTypeVoid.wat │ │ ├── BadSigTooFewParams.txt │ │ ├── BadSigTooFewParams.wat │ │ ├── BadSigTooManyParams.txt │ │ └── BadSigTooManyParams.wat └── module_rest │ ├── Array.txt │ ├── Array.wat │ ├── ArrayMutField.txt │ ├── ArrayMutField.wat │ ├── BadArrayNoFields.txt │ ├── BadArrayNoFields.wat │ ├── BadArrayTooManyFields.txt │ ├── BadArrayTooManyFields.wat │ ├── BadBinaryModuleMagic.txt │ ├── BadBinaryModuleMagic.wat │ ├── BadImportTableShared.txt │ ├── BadImportTableShared.wat │ ├── BadMemorySharedNomax.txt │ ├── BadMemorySharedNomax.wat │ ├── BadModuleWithAssert.txt │ ├── BadModuleWithAssert.wat │ ├── BinaryModule.txt │ ├── BinaryModule.wat │ ├── Event.txt │ ├── Event.wat │ ├── ExportEvent.txt │ ├── ExportEvent.wat │ ├── ImportEvent.txt │ ├── ImportEvent.wat │ ├── ImportMemoryShared.txt │ ├── ImportMemoryShared.wat │ ├── MemoryShared.txt │ ├── MemoryShared.wat │ ├── Struct.txt │ ├── Struct.wat │ ├── StructAndFunc.txt │ ├── StructAndFunc.wat │ ├── StructFieldName.txt │ ├── StructFieldName.wat │ ├── StructMutField.txt │ ├── StructMutField.wat │ └── semantic │ ├── BadExportFuncNameUndefined.txt │ ├── BadExportFuncNameUndefined.wat │ ├── BadExportFuncUndefined.txt │ ├── BadExportFuncUndefined.wat │ ├── BadExportGlobalNameUndefined.txt │ ├── BadExportGlobalNameUndefined.wat │ ├── BadExportGlobalUndefined.txt │ ├── BadExportGlobalUndefined.wat │ ├── BadExportMemoryNameUndefined.txt │ ├── BadExportMemoryNameUndefined.wat │ ├── BadExportMemoryUndefined.txt │ ├── BadExportMemoryUndefined.wat │ ├── BadExportTableNameUndefined.txt │ ├── BadExportTableNameUndefined.wat │ ├── BadExportTableUndefined.txt │ ├── BadExportTableUndefined.wat │ ├── BadFuncRedefinition.txt │ ├── BadFuncRedefinition.wat │ ├── BadGlobalInvalidExpr.txt │ ├── BadGlobalInvalidExpr.wat │ ├── BadGlobalInvalidGetglobal.txt │ ├── BadGlobalInvalidGetglobal.wat │ ├── BadImportFuncRedefinition.txt │ ├── BadImportFuncRedefinition.wat │ ├── BadImportGlobalRedefinition.txt │ ├── BadImportGlobalRedefinition.wat │ ├── BadImportMemoryRedefinition.txt │ ├── BadImportMemoryRedefinition.wat │ ├── BadImportTableRedefinition.txt │ ├── BadImportTableRedefinition.wat │ ├── BadMemoryInitSizeTooBig.txt │ ├── BadMemoryInitSizeTooBig.wat │ ├── BadMemoryMaxLessThanInit.txt │ ├── BadMemoryMaxLessThanInit.wat │ ├── BadMemoryMaxSizeTooBig.txt │ ├── BadMemoryMaxSizeTooBig.wat │ ├── BadMemoryTooMany.txt │ ├── BadMemoryTooMany.wat │ ├── BadModuleMulti.txt │ ├── BadModuleMulti.wat │ ├── BadStartNotNullary.txt │ ├── BadStartNotNullary.wat │ ├── BadStartNotVoid.txt │ ├── BadStartNotVoid.wat │ ├── BadStartTooMany.txt │ ├── BadStartTooMany.wat │ ├── BadTableInvalidFunction.txt │ ├── BadTableInvalidFunction.wat │ ├── BadTableTooMany.txt │ └── BadTableTooMany.wat └── module ├── BadElemRedefinition.txt ├── BadElemRedefinition.wat ├── BadExportFuncEmpty.txt ├── BadExportFuncEmpty.wat ├── BadExportFuncName.txt ├── BadExportFuncName.wat ├── BadExportFuncNoString.txt ├── BadExportFuncNoString.wat ├── BadExportFuncTooMany.txt ├── BadExportFuncTooMany.wat ├── BadImportFuncNotParam.txt ├── BadImportFuncNotParam.wat ├── BadImportFuncNotResult.txt ├── BadImportFuncNotResult.wat ├── BadImportFuncOneString.txt ├── BadImportFuncOneString.wat ├── BadMemoryEmpty.txt ├── BadMemoryEmpty.wat ├── BadMemoryInitSize.txt ├── BadMemoryInitSize.wat ├── BadMemoryInitSizeNegative.txt ├── BadMemoryInitSizeNegative.wat ├── BadMemoryMaxSize.txt ├── BadMemoryMaxSize.wat ├── BadMemoryMaxSizeNegative.txt ├── BadMemoryMaxSizeNegative.wat ├── BadMemorySegmentAddress.txt ├── BadMemorySegmentAddress.wat ├── BadModuleNoClose.txt ├── BadModuleNoClose.wat ├── BadTableElem.txt ├── BadTableElem.wat ├── DataOffset.txt ├── DataOffset.wat ├── ElemOffset.txt ├── ElemOffset.wat ├── ExportFunc.txt ├── ExportFunc.wat ├── ExportFuncMulti.txt ├── ExportFuncMulti.wat ├── ExportFuncNamed.txt ├── ExportFuncNamed.wat ├── ExportGlobal.txt ├── ExportGlobal.wat ├── ExportMemory.txt ├── ExportMemory.wat ├── ExportMemoryInline.txt ├── ExportMemoryInline.wat ├── ExportMemoryInlineSeveral.txt ├── ExportMemoryInlineSeveral.wat ├── ExportMemoryMulti.txt ├── ExportMemoryMulti.wat ├── ExportTable.txt ├── ExportTable.wat ├── Global.txt ├── Global.wat ├── GlobalExnref.txt ├── GlobalExnref.wat ├── ImportFunc.txt ├── ImportFunc.wat ├── ImportFuncNoParam.txt ├── ImportFuncNoParam.wat ├── ImportFuncType.txt ├── ImportFuncType.wat ├── ImportGlobal.txt ├── ImportGlobal.wat ├── ImportGlobalGetglobal.txt ├── ImportGlobalGetglobal.wat ├── ImportMemory.txt ├── ImportMemory.wat ├── ImportMutableGlobal.txt ├── ImportMutableGlobal.wat ├── ImportTable.txt ├── ImportTable.wat ├── MemoryInitMaxSize.txt ├── MemoryInitMaxSize.wat ├── MemoryInitSize.txt ├── MemoryInitSize.wat ├── MemorySegment1.txt ├── MemorySegment1.wat ├── MemorySegmentLong.txt ├── MemorySegmentLong.wat ├── MemorySegmentMany.txt ├── MemorySegmentMany.wat ├── MemorySegmentMultiString.txt ├── MemorySegmentMultiString.wat ├── MemorySegmentPassive.txt ├── MemorySegmentPassive.wat ├── ModuleEmpty.txt ├── ModuleEmpty.wat ├── ReferenceTypesDisabled.txt ├── ReferenceTypesDisabled.wat ├── Start.txt ├── Start.wat ├── StartNamed.txt ├── StartNamed.wat ├── Table.txt ├── Table.wat ├── TableElemExpr.txt ├── TableElemExpr.wat ├── TableElemVar.txt ├── TableElemVar.wat ├── TableNamed.txt ├── TableNamed.wat ├── Type.txt ├── Type.wat ├── TypeEmpty.txt ├── TypeEmpty.wat ├── TypeEmptyParam.txt ├── TypeEmptyParam.wat ├── TypeMultiParam.txt ├── TypeMultiParam.wat ├── TypeNoParam.txt └── TypeNoParam.wat /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | build 25 | .idea 26 | .gradle 27 | /idea-flex.skeleton -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "web-assembly-plugin" 2 | 3 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/parser/WebAssemblyParserUtil.java: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.lang.parser; 2 | 3 | import com.intellij.lang.parser.GeneratedParserUtilBase; 4 | 5 | public class WebAssemblyParserUtil extends GeneratedParserUtilBase { 6 | } 7 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyAligneq.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyAligneq extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyBlockinstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyBlockinstr extends PsiElement { 9 | 10 | @Nullable 11 | WebAssemblyBlocktype getBlocktype(); 12 | 13 | @NotNull 14 | List getFoldeinstrList(); 15 | 16 | @NotNull 17 | List getInstrList(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyBlocktype.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyBlocktype extends PsiElement { 9 | 10 | @Nullable 11 | WebAssemblyResult getResult(); 12 | 13 | @Nullable 14 | WebAssemblyTypeuse getTypeuse(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyCallInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyCallInstr extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyIdx getIdx(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyComment.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyComment extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyElemDropInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyElemDropInstr extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyIdx getIdx(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyExport.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyExport extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyExportdesc getExportdesc(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyExportdesc.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyExportdesc extends PsiElement { 9 | 10 | @Nullable 11 | WebAssemblyIdx getIdx(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyFunctype.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyFunctype extends PsiElement { 9 | 10 | @NotNull 11 | List getParamList(); 12 | 13 | @NotNull 14 | List getResultList(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyGlobalInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyGlobalInstr extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyIdx getIdx(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyGlobaltype.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyGlobaltype extends PsiElement { 9 | 10 | @Nullable 11 | WebAssemblyValtype getValtype(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyIdx.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyIdx extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyImport.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyImport extends WebAssemblyNamedElement { 9 | 10 | @Nullable 11 | WebAssemblyImportdesc getImportdesc(); 12 | 13 | @Nullable 14 | PsiElement setName(@NotNull String name); 15 | 16 | @Nullable 17 | PsiElement getNameIdentifier(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyImportdesc.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyImportdesc extends PsiElement { 9 | 10 | @Nullable 11 | WebAssemblyGlobaltype getGlobaltype(); 12 | 13 | @Nullable 14 | WebAssemblyMemtype getMemtype(); 15 | 16 | @Nullable 17 | WebAssemblyTabletype getTabletype(); 18 | 19 | @Nullable 20 | WebAssemblyTypeuse getTypeuse(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyInlineData.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyInlineData extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyInlineElem.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyInlineElem extends PsiElement { 9 | 10 | @Nullable 11 | WebAssemblyElemlist getElemlist(); 12 | 13 | @NotNull 14 | List getInstrList(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyInlineExport.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyInlineExport extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyInlineImport.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyInlineImport extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyInstr extends PsiElement { 9 | 10 | @Nullable 11 | WebAssemblyBlockinstr getBlockinstr(); 12 | 13 | @Nullable 14 | WebAssemblyFoldeinstr getFoldeinstr(); 15 | 16 | @Nullable 17 | WebAssemblyPlaininstr getPlaininstr(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyLexerTokens.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyLexerTokens extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyLocal.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyLocal extends WebAssemblyNamedElement { 9 | 10 | @NotNull 11 | List getValtypeList(); 12 | 13 | @Nullable 14 | PsiElement setName(@NotNull String name); 15 | 16 | @Nullable 17 | PsiElement getNameIdentifier(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyLocalInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyLocalInstr extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyIdx getIdx(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyMemoryIdxInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyMemoryIdxInstr extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyIdx getIdx(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyMemtype.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyMemtype extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyModule.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyModule extends PsiElement { 9 | 10 | @NotNull 11 | List getModulefieldList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyOffseteq.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyOffseteq extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyParam.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyParam extends WebAssemblyNamedElement { 9 | 10 | @NotNull 11 | List getValtypeList(); 12 | 13 | @Nullable 14 | PsiElement setName(@NotNull String name); 15 | 16 | @Nullable 17 | PsiElement getNameIdentifier(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyRefFuncInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyRefFuncInstr extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyIdx getIdx(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyResult.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyResult extends PsiElement { 9 | 10 | @NotNull 11 | List getValtypeList(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyStart.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyStart extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyIdx getIdx(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyTableCopyInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyTableCopyInstr extends WebAssemblyReferencedElement { 10 | 11 | @NotNull 12 | List getIdxList(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyTableIdxInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyTableIdxInstr extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyIdx getIdx(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyTableInitInstr.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyTableInitInstr extends WebAssemblyReferencedElement { 10 | 11 | @NotNull 12 | List getIdxList(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyTabletype.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyTabletype extends PsiElement { 9 | 10 | @NotNull 11 | WebAssemblyMemtype getMemtype(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyType.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyType extends WebAssemblyNamedElement { 9 | 10 | @Nullable 11 | WebAssemblyFunctype getFunctype(); 12 | 13 | @Nullable 14 | PsiElement setName(@NotNull String name); 15 | 16 | @Nullable 17 | PsiElement getNameIdentifier(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyTypeuse.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyTypeuse extends PsiElement { 9 | 10 | @NotNull 11 | List getParamList(); 12 | 13 | @NotNull 14 | List getResultList(); 15 | 16 | @Nullable 17 | WebAssemblyTypeuseTyperef getTypeuseTyperef(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyTypeuseTyperef.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | import com.intellij.psi.PsiReference; 8 | 9 | public interface WebAssemblyTypeuseTyperef extends WebAssemblyReferencedElement { 10 | 11 | @Nullable 12 | WebAssemblyIdx getIdx(); 13 | 14 | @Nullable 15 | PsiReference getReference(); 16 | 17 | @NotNull 18 | PsiReference[] getReferences(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/gen/org/jetbrains/webstorm/lang/psi/WebAssemblyValtype.java: -------------------------------------------------------------------------------- 1 | // This is a generated file. Not intended for manual editing. 2 | package org.jetbrains.webstorm.lang.psi; 3 | 4 | import java.util.List; 5 | import org.jetbrains.annotations.*; 6 | import com.intellij.psi.PsiElement; 7 | 8 | public interface WebAssemblyValtype extends PsiElement { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/kotlin/org/jetbrains/webstorm/ide/WebAssemblypSyntaxHighlighterFactory.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.ide 2 | 3 | import com.intellij.openapi.fileTypes.SyntaxHighlighter 4 | import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory 5 | import com.intellij.openapi.project.Project 6 | import com.intellij.openapi.vfs.VirtualFile 7 | 8 | class WebAssemblySyntaxHighlighterFactory : SyntaxHighlighterFactory() { 9 | override fun getSyntaxHighlighter(project: Project?, virtualFile: VirtualFile?): SyntaxHighlighter 10 | = WebAssemblySyntaxHighlighter() 11 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/jetbrains/webstorm/ide/icons/WebAssemblyIcons.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.ide.icons 2 | 3 | import com.intellij.openapi.util.IconLoader 4 | 5 | object WebAssemblyIcons { 6 | val WEB_ASSEMBLY_FILE = IconLoader.getIcon("/icons/webAssemblyFiletype.svg", WebAssemblyIcons::class.java.classLoader) 7 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/jetbrains/webstorm/lang/WebAssemblyCommenter.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.lang 2 | 3 | import com.intellij.lang.Commenter 4 | 5 | class WebAssemblyCommenter : Commenter { 6 | override fun getCommentedBlockCommentPrefix(): String? = "(;" 7 | override fun getCommentedBlockCommentSuffix(): String? = ";)" 8 | override fun getBlockCommentPrefix(): String? = "(;" 9 | override fun getBlockCommentSuffix(): String? = ";)" 10 | override fun getLineCommentPrefix(): String? = ";;" 11 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/jetbrains/webstorm/lang/WebAssemblyLanguage.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.lang 2 | 3 | import com.intellij.lang.Language 4 | 5 | object WebAssemblyLanguage : Language("WebAssembly") { 6 | override fun isCaseSensitive() = true 7 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/jetbrains/webstorm/lang/lexer/WebAssemblyLexer.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.lang.lexer 2 | 3 | import com.intellij.lexer.FlexAdapter 4 | import java.io.Reader 5 | 6 | class WebAssemblyLexer : FlexAdapter(_WebAssemblyLexer(null as Reader?)) -------------------------------------------------------------------------------- /src/main/kotlin/org/jetbrains/webstorm/lang/psi/WebAssemblyFile.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.lang.psi 2 | 3 | import com.intellij.extapi.psi.PsiFileBase 4 | import com.intellij.psi.FileViewProvider 5 | import org.jetbrains.webstorm.lang.WebAssemblyLanguage 6 | 7 | 8 | class WebAssemblyFile(viewProvider: FileViewProvider?) : PsiFileBase(viewProvider!!, WebAssemblyLanguage) { 9 | override fun getFileType() = WebAssemblyFileType 10 | override fun toString() = "WebAssembly File" 11 | } -------------------------------------------------------------------------------- /src/main/kotlin/org/jetbrains/webstorm/lang/psi/WebAssemblyNamedElement.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.lang.psi 2 | 3 | import com.intellij.psi.PsiElement 4 | import com.intellij.psi.PsiNameIdentifierOwner 5 | 6 | interface WebAssemblyNamedElement : PsiNameIdentifierOwner, PsiElement -------------------------------------------------------------------------------- /src/main/kotlin/org/jetbrains/webstorm/lang/psi/WebAssemblyNamedReferencedElement.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.lang.psi 2 | 3 | interface WebAssemblyNamedReferencedElement : WebAssemblyNamedElement, WebAssemblyReferencedElement -------------------------------------------------------------------------------- /src/main/kotlin/org/jetbrains/webstorm/lang/psi/WebAssemblyReferencedElement.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.lang.psi 2 | 3 | import com.intellij.psi.PsiElement 4 | 5 | interface WebAssemblyReferencedElement : PsiElement -------------------------------------------------------------------------------- /src/test/README.md: -------------------------------------------------------------------------------- 1 | # Sources of tests 2 | - https://github.com/WebAssembly/wabt/tree/master/test/parse 3 | - https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format 4 | - https://github.com/mdn/webassembly-examples/tree/master/js-api-examples -------------------------------------------------------------------------------- /src/test/kotlin/org/jetbrains/webstorm/lang/parser/WebAssemblyTestFilePrevVersion.kt: -------------------------------------------------------------------------------- 1 | package org.jetbrains.webstorm.lang.parser 2 | 3 | import org.junit.Test 4 | 5 | class WebAssemblyTestFilePrevVersion : WebAssemblyTestBase("file_v1.0") { 6 | @Test 7 | fun testAdd() = doTest() 8 | @Test 9 | fun testShared0() = doTest() 10 | @Test 11 | fun testShared1() = doTest() 12 | @Test 13 | fun testTable() = doTest() 14 | @Test 15 | fun testTable2() = doTest() 16 | @Test 17 | fun testWasmTable() = doTest() 18 | } -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/Br.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block 5 | br 0 6 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/BrLoop.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | loop $exit 5 | br $exit 6 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/BrifNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block $foo 5 | i32.const 1 6 | br_if $foo 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/Brtable.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block 5 | block 6 | block 7 | i32.const 0 8 | br_table 0 1 9 | end 10 | nop 11 | end 12 | nop 13 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/ExprBrif.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | block $exit (result i32) 5 | i32.const 0 6 | i32.const 0 7 | br_if 0 8 | drop 9 | i32.const 1 10 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/If.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 1 5 | if 6 | nop 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/IfReturn.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | i32.const 1 5 | if (result i32) 6 | i32.const 2 7 | return 8 | else 9 | i32.const 3 10 | return 11 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/IfThenBr.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 1 5 | if 6 | br 0 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/IfThenBrNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 1 5 | if $exit 6 | br $exit 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/IfThenElseBr.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | i32.const 1 5 | if (result i32) 6 | i32.const 1 7 | br 0 8 | else 9 | i32.const 1 10 | br 0 11 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/IfThenElseBrNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | i32.const 1 5 | if $exit (result i32) 6 | i32.const 1 7 | br $exit 8 | else 9 | i32.const 2 10 | br $exit 11 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/codeFolding/Loop.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | loop 5 | nop 6 | nop 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/editor/reference/BulkMemoryNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | 4 | (module 5 | (memory 1) 6 | (data $data "a") 7 | (func 8 | i32.const 0 i32.const 0 i32.const 0 memory.init $data 9 | data.drop $data 10 | ) 11 | 12 | (table 1 anyfunc) 13 | (elem $elem funcref (ref.func 0) (ref.null func)) 14 | (elem $elem2 func 0) 15 | (func 16 | i32.const 0 i32.const 0 i32.const 0 table.init $elem 17 | elem.drop $elem 18 | ) 19 | ) -------------------------------------------------------------------------------- /src/test/resources/editor/reference/Call.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (func (param i32) 3 | if call 0 else call 1 end) 4 | (func $f (param i32) 5 | i32.const 1 6 | call 0 7 | call $f) 8 | ) -------------------------------------------------------------------------------- /src/test/resources/editor/reference/ExportGlobal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (global i32 (i32.const 0)) 4 | (global (mut f32) (f32.const 0)) 5 | (export "global0" (global 0)) 6 | 7 | (memory 1) 8 | (export "mem1" (memory 0)) 9 | (export "mem2" (memory 0)) 10 | 11 | (table 0 anyfunc) 12 | (export "my_table" (table 0)) 13 | 14 | (func $n (result i32) (i32.const 0)) 15 | (export "n" (func $n)) 16 | 17 | (func (nop)) 18 | (export "a" (func 1)) 19 | (export "b" (func 1)) 20 | ) -------------------------------------------------------------------------------- /src/test/resources/editor/reference/ReferenceTypesCallIndirect.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-reference-types 3 | 4 | (module 5 | (table $foo 1 anyfunc) 6 | (table $bar 1 anyfunc) 7 | 8 | (func (result i32) i32.const 0) 9 | (func (result i32) i32.const 1) 10 | 11 | (func (result i32) 12 | i32.const 0 13 | call_indirect $foo (type 0)) 14 | 15 | (func (result i32) 16 | i32.const 0 17 | call_indirect $bar (type 0)) 18 | 19 | (type (func (param i32))) 20 | ) -------------------------------------------------------------------------------- /src/test/resources/editor/reference/ReferenceTypesNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-reference-types 3 | 4 | (module 5 | (table $foo 1 externref) 6 | (table 1 externref) 7 | 8 | (func (result externref) 9 | i32.const 0 10 | table.get $foo 11 | ) 12 | (func (param externref) 13 | i32.const 0 14 | get_local 0 15 | table.set $foo 16 | ) 17 | (func (result i32) 18 | ref.null extern 19 | i32.const 0 20 | table.grow 1 21 | ) 22 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadCrlf.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/common/BadCrlf.txt -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadCrlf.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | modulez 4 | funcz 5 | (;; STDERR ;;; 6 | out/test/parse/bad-crlf.txt:3:1: error: unexpected token "modulez", expected a module field or a module. 7 | modulez 8 | ^^^^^^^ 9 | out/test/parse/bad-crlf.txt:4:1: error: unexpected token funcz, expected EOF. 10 | funcz 11 | ^^^^^ 12 | ;;; STDERR ;;) 13 | -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadErrorLongLine.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | whoops (; some text at the end of the line ;) 4 | (;; STDERR ;;; 5 | out/test/parse/bad-error-long-line.txt:3:170: error: unexpected token "whoops", expected a module field or a module. 6 | ... whoops (; some text... 7 | ^^^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadInputCommand.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/common/BadInputCommand.txt -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadInputCommand.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | ;; syntax is (input name? text) 4 | (input "hello") 5 | (input $var "hello") 6 | (;; STDERR ;;; 7 | out/test/parse/bad-input-command.txt:4:2: error: input command is not supported 8 | (input "hello") 9 | ^^^^^ 10 | out/test/parse/bad-input-command.txt:5:2: error: input command is not supported 11 | (input $var "hello") 12 | ^^^^^ 13 | ;;; STDERR ;;) 14 | -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadOutputCommand.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/common/BadOutputCommand.txt -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadSingleSemicolon.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/common/BadSingleSemicolon.txt -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadSingleSemicolon.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | ; foo bar 4 | (module) 5 | (;; STDERR ;;; 6 | out/test/parse/bad-single-semicolon.txt:3:1: error: unexpected char 7 | ; foo bar 8 | ^ 9 | out/test/parse/bad-single-semicolon.txt:3:3: error: unexpected token "foo", expected a module field or a module. 10 | ; foo bar 11 | ^^^ 12 | out/test/parse/bad-single-semicolon.txt:3:7: error: unexpected token bar, expected EOF. 13 | ; foo bar 14 | ^^^ 15 | ;;; STDERR ;;) 16 | -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadStringEof.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func) (export " 4 | (;; STDERR ;;; 5 | out/test/parse/bad-string-eof.txt:3:25: error: newline in string 6 | (module (func) (export " 7 | ^ 8 | out/test/parse/bad-string-eof.txt:4:1: error: unexpected token "EOF", expected a quoted string (e.g. "foo"). 9 | ;;; STDERR ;;) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadToplevel.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/common/BadToplevel.txt -------------------------------------------------------------------------------- /src/test/resources/parser/common/BadToplevel.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (foo bar) 4 | (;; STDERR ;;; 5 | out/test/parse/bad-toplevel.txt:3:2: error: unexpected token "foo", expected a module field or a module. 6 | (foo bar) 7 | ^^^ 8 | out/test/parse/bad-toplevel.txt:3:6: error: unexpected token bar, expected EOF. 9 | (foo bar) 10 | ^^^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/common/Basic.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | i32.const 42 5 | return)) -------------------------------------------------------------------------------- /src/test/resources/parser/common/EmptyFile.txt: -------------------------------------------------------------------------------- 1 | WebAssembly File(0,178) 2 | PsiComment(WebAssemblyToken.LINE_COMMENT)(';;; TOOL: wat2wasm')(0,18) 3 | PsiWhiteSpace('\n')(18,19) 4 | PsiComment(WebAssemblyToken.LINE_COMMENT)(';;; ERROR: 1')(19,31) 5 | PsiWhiteSpace('\n')(31,32) 6 | PsiComment(WebAssemblyToken.LINE_COMMENT)(';; empty file')(32,45) 7 | PsiWhiteSpace('\n')(45,46) 8 | PsiComment(WebAssemblyToken.BLOCK_COMMENT)('(;; STDERR ;;;\nout/test/parse/empty-file.txt:4:1: error: unexpected token "EOF", expected a module field or a module.\n;;; STDERR ;;)')(46,178) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/common/EmptyFile.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | ;; empty file 4 | (;; STDERR ;;; 5 | out/test/parse/empty-file.txt:4:1: error: unexpected token "EOF", expected a module field or a module. 6 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/common/ExportMutableGlobal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (global (export "g") (mut f32) (f32.const 1.5))) -------------------------------------------------------------------------------- /src/test/resources/parser/common/ForceColor.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ENV: FORCE_COLOR=1 3 | ;;; ERROR: 1 4 | (module 5 | (func badname (param i32) (result badtype) 6 | drop)) 7 | (;; STDERR ;;; 8 | out/test/parse/force-color.txt:5:9: error: unexpected token badname, expected ). 9 | (func badname (param i32) (result badtype) 10 | ^^^^^^^ 11 | out/test/parse/force-color.txt:5:37: error: unexpected token badtype. 12 | (func badname (param i32) (result badtype) 13 | ^^^^^^^ 14 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/common/LineComment.txt: -------------------------------------------------------------------------------- 1 | WebAssembly File(0,67) 2 | PsiComment(WebAssemblyToken.LINE_COMMENT)(';;; TOOL: wat2wasm')(0,18) 3 | PsiWhiteSpace('\n')(18,19) 4 | PsiComment(WebAssemblyToken.LINE_COMMENT)(';; here is a comment')(19,39) 5 | PsiWhiteSpace('\n')(39,40) 6 | WebAssemblyModuleImpl(MODULE)(40,48) 7 | PsiElement(WebAssemblyToken.LPAR)('(')(40,41) 8 | PsiElement(WebAssemblyToken.MODULEKEY)('module')(41,47) 9 | PsiElement(WebAssemblyToken.RPAR)(')')(47,48) 10 | PsiWhiteSpace('\n')(48,49) 11 | PsiComment(WebAssemblyToken.LINE_COMMENT)(';; here is another')(49,67) -------------------------------------------------------------------------------- /src/test/resources/parser/common/LineComment.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;; here is a comment 3 | (module) 4 | ;; here is another -------------------------------------------------------------------------------- /src/test/resources/parser/common/NestedComments.txt: -------------------------------------------------------------------------------- 1 | WebAssembly File(0,64) 2 | PsiComment(WebAssemblyToken.LINE_COMMENT)(';;; TOOL: wat2wasm')(0,18) 3 | PsiWhiteSpace('\n')(18,19) 4 | WebAssemblyModuleImpl(MODULE)(19,64) 5 | PsiElement(WebAssemblyToken.LPAR)('(')(19,20) 6 | PsiElement(WebAssemblyToken.MODULEKEY)('module')(20,26) 7 | PsiWhiteSpace('\n ')(26,29) 8 | PsiComment(WebAssemblyToken.BLOCK_COMMENT)('(; foo bar\n (; baz\n ;)\n ;)')(29,62) 9 | PsiWhiteSpace('\n')(62,63) 10 | PsiElement(WebAssemblyToken.RPAR)(')')(63,64) -------------------------------------------------------------------------------- /src/test/resources/parser/common/NestedComments.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (; foo bar 4 | (; baz 5 | ;) 6 | ;) 7 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/common/Stdin.wat: -------------------------------------------------------------------------------- 1 | ;;; RUN: %(wat2wasm)s -o %(out_dir)s/tmp.wasm 2 | ;;; ARGS: - 3 | ;;; STDIN: %(in_file)s 4 | ;;; RUN: %(wasm-objdump)s -x 5 | ;;; STDIN: %(out_dir)s/tmp.wasm 6 | ;;; ARGS: - 7 | (module 8 | (func (result i32) 9 | i32.const 42 10 | return) 11 | ) 12 | (;; STDOUT ;;; 13 | 14 | : file format wasm 0x1 15 | 16 | Section Details: 17 | 18 | Type[1]: 19 | - type[0] () -> i32 20 | Function[1]: 21 | - func[0] sig=0 22 | Code[1]: 23 | - func[0] size=5 24 | ;;; STDOUT ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/common/StringEscape.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func) (export "tab:\t newline:\n slash:\\ quote:\' double:\"" (func 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/common/StringHex.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func) (export "foo\de\ad\ca\bb" (func 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadBrName.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | block $foo 5 | br foo 6 | end)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-br-name.txt:5:16: error: unexpected token "foo", expected a numeric index or a name (e.g. 12 or $foo). 9 | br foo 10 | ^^^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadBrNoDepth.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | block 6 | br 7 | end)) 8 | (;; STDERR ;;; 9 | out/test/parse/expr/bad-br-no-depth.txt:7:5: error: unexpected token "end", expected a numeric index or a name (e.g. 12 or $foo). 10 | end)) 11 | ^^^ 12 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadBrtableNoVars.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func br_table)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-brtable-no-vars.txt:3:23: error: unexpected token ")", expected a var (e.g. 12 or $foo). 6 | (module (func br_table)) 7 | ^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadConstF32Trailing.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func f32.const 1234.5678foo)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-const-f32-trailing.txt:3:25: error: unexpected token "1234.5678foo", expected a numeric literal (e.g. 123, -45, 6.7e8). 6 | (module (func f32.const 1234.5678foo)) 7 | ^^^^^^^^^^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadConstI32Garbage.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func i32.const one-hundred)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-const-i32-garbage.txt:3:25: error: unexpected token "one-hundred", expected a numeric literal (e.g. 123, -45, 6.7e8). 6 | (module (func i32.const one-hundred)) 7 | ^^^^^^^^^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadConstI32JustNegativeSign.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func i32.const -)) 5 | (;; STDERR ;;; 6 | out/test/parse/expr/bad-const-i32-just-negative-sign.txt:4:19: error: unexpected token "-", expected a numeric literal (e.g. 123, -45, 6.7e8). 7 | (func i32.const -)) 8 | ^ 9 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadConstI32Trailing.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func i32.const 100x)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-const-i32-trailing.txt:3:25: error: unexpected token "100x", expected a numeric literal (e.g. 123, -45, 6.7e8). 6 | (module (func i32.const 100x)) 7 | ^^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadConvertFloatSign.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | f32.const 0 5 | f32.converts.f64)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-convert-float-sign.txt:5:11: error: unexpected token f32.converts.f64, expected ). 8 | f32.converts.f64)) 9 | ^^^^^^^^^^^^^^^^ 10 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadConvertIntNoSign.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 5 | i32.convert.i32)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-convert-int-no-sign.txt:5:11: error: unexpected token "i32.convert.i32", expected a numeric literal (e.g. 123, -45, 6.7e8). 8 | i32.convert.i32)) 9 | ^^^^^^^^^^^^^^^ 10 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadGetlocalName.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (local $f f32) get_local f)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-getlocal-name.txt:3:40: error: unexpected token "f", expected a numeric index or a name (e.g. 12 or $foo). 6 | (module (func (local $f f32) get_local f)) 7 | ^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadIfNoThen.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (if (i32.const 0)))) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-if-no-then.txt:3:32: error: unexpected token ")", expected then block (e.g. (then ...)). 6 | (module (func (if (i32.const 0)))) 7 | ^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadLoadAlign.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (i32.load align=foo (i32.const 0)))) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-load-align.txt:3:25: error: unexpected token align=foo, expected ). 6 | (module (func (i32.load align=foo (i32.const 0)))) 7 | ^^^^^^^^^ 8 | out/test/parse/expr/bad-load-align.txt:3:50: error: unexpected token ), expected EOF. 9 | (module (func (i32.load align=foo (i32.const 0)))) 10 | ^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadLoadAlignMisspelled.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | i32.const 0 6 | i32.load aline=64)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-load-align-misspelled.txt:6:14: error: unexpected token aline=64, expected ). 9 | i32.load aline=64)) 10 | ^^^^^^^^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadLoadAlignNegative.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | i32.load8_s align=-1)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-load-align-negative.txt:5:23: error: unexpected token align=-1, expected ). 8 | i32.load8_s align=-1)) 9 | ^^^^^^^^ 10 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadLoadFloatSign.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | f32.loads)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-load-float-sign.txt:5:11: error: unexpected token f32.loads, expected ). 8 | f32.loads)) 9 | ^^^^^^^^^ 10 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadLoadOffsetNegative.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | i32.load8_s offset=-1)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-load-offset-negative.txt:5:23: error: unexpected token offset=-1, expected ). 8 | i32.load8_s offset=-1)) 9 | ^^^^^^^^^ 10 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadLoadType.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | load.x32)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-load-type.txt:5:11: error: unexpected token load.x32, expected ). 8 | load.x32)) 9 | ^^^^^^^^ 10 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadNop.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | nop 5 | foo)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-nop.txt:5:11: error: unexpected token foo, expected ). 8 | foo)) 9 | ^^^ 10 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadSetlocalName.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | (local $n i32) 5 | i32.const 0 6 | set_local n)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-setlocal-name.txt:6:13: error: unexpected token "n", expected a numeric index or a name (e.g. 12 or $foo). 9 | set_local n)) 10 | ^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadStoreAlign.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | i32.const 0 6 | i32.store align=foo)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-store-align.txt:6:21: error: unexpected token align=foo, expected ). 9 | i32.store align=foo)) 10 | ^^^^^^^^^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadStoreFloatSign.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | f32.const 0 6 | f32.storeu)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-store-float.sign.txt:6:11: error: unexpected token f32.storeu, expected ). 9 | f32.storeu)) 10 | ^^^^^^^^^^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadStoreOffsetNegative.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | i32.const 0 6 | i32.store8 offset=-1)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-store-offset-negative.txt:6:22: error: unexpected token offset=-1, expected ). 9 | i32.store8 offset=-1)) 10 | ^^^^^^^^^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadStoreType.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | f32.const 0 6 | store.float32)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-store-type.txt:6:11: error: unexpected token store.float32, expected ). 9 | store.float32)) 10 | ^^^^^^^^^^^^^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadUnexpected.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/expr/BadUnexpected.txt -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BadUnexpected.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (module))) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-unexpected.txt:3:16: error: unexpected token "module", expected an instr. 6 | (module (func (module))) 7 | ^^^^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Block.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block 5 | nop 6 | block 7 | nop 8 | nop 9 | end 10 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BlockMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | ;; block w/ multiple results 4 | (func 5 | block (result i32 i64) 6 | i32.const 0 7 | i64.const 0 8 | end 9 | return) 10 | 11 | ;; block w/ params 12 | (func 13 | i32.const 0 14 | block (param i32) (result i32 i32) 15 | i32.const 1 16 | end 17 | return) 18 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BlockNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block $foo 5 | nop 6 | nop 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BlockReturn.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | block (result i32) 5 | nop 6 | i32.const 1 7 | return 8 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Br.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block 5 | br 0 6 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BrBlock.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block $exit1 5 | br 0 6 | end 7 | block $exit2 8 | br $exit2 9 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BrLoop.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | loop $exit 5 | br $exit 6 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BrNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func 3 | block $foo 4 | br $foo 5 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Brif.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block $foo 5 | i32.const 1 6 | br_if 0 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BrifNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block $foo 5 | i32.const 1 6 | br_if $foo 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Brtable.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block 5 | block 6 | block 7 | i32.const 0 8 | br_table 0 1 9 | end 10 | nop 11 | end 12 | nop 13 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BrtableMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block 5 | block 6 | block 7 | block 8 | block 9 | i32.const 0 10 | br_table 4 3 2 1 0 11 | end 12 | nop 13 | end 14 | nop 15 | end 16 | nop 17 | end 18 | nop 19 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BrtableNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | block $exit 5 | block $1 6 | block $0 7 | i32.const 0 8 | br_table $0 $1 $exit 9 | end 10 | nop 11 | end 12 | nop 13 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/BulkMemoryNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | 4 | (module 5 | (memory 1) 6 | (data $data "a") 7 | (func 8 | i32.const 0 i32.const 0 i32.const 0 memory.init $data 9 | data.drop $data 10 | ) 11 | 12 | (table 1 anyfunc) 13 | (elem $elem funcref (ref.func 0) (ref.null func)) 14 | (elem $elem2 func 0) 15 | (func 16 | i32.const 0 i32.const 0 i32.const 0 table.init $elem 17 | elem.drop $elem 18 | ) 19 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Call.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param i32) 4 | i32.const 1 5 | call 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/CallDefinedLater.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func $foo 4 | i32.const 1 5 | i32.const 0 6 | call $bar 7 | drop) 8 | (func $bar (param i32 i32) (result i32) 9 | i32.const 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/CallNamePrefix.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func $foomore 4 | i32.const 0 5 | call $foo) 6 | (func $foo (param i32) 7 | nop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/CallNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func $foo (param f32) 4 | f32.const 0.0 5 | call $foo)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Callimport.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (import "foo" "bar" (func (param i32) (result i32))) 4 | (func (param i32) (result i32) 5 | i32.const 0 6 | call 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/CallimportNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (import "foo" "bar" (func $bar (param f32))) 4 | (func 5 | f32.const 0 6 | call $bar)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/CallimportType.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (type (func (param i32) (result i32))) 4 | (import "foo" "bar" (func (type 0))) 5 | (func (param i32) (result i32) 6 | i32.const 0 7 | call 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Callindirect.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (table anyfunc (elem 0)) 4 | (type (func (param i32))) 5 | (func 6 | i32.const 0 7 | i32.const 0 8 | call_indirect (type 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/CallindirectNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (table anyfunc (elem 0)) 4 | (type $t (func (param i32))) 5 | (func $g 6 | i32.const 0 7 | i32.const 0 8 | call_indirect (type $t))) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Cast.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 0 5 | f32.reinterpret/i32 6 | drop 7 | f32.const 0 8 | i32.reinterpret/f32 9 | drop 10 | i64.const 0 11 | f64.reinterpret/i64 12 | drop 13 | f64.const 0 14 | i64.reinterpret/f64 15 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/ConvertSat.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | f32.const 0 5 | i32.trunc_s/f32 6 | drop 7 | 8 | f32.const 0 9 | i32.trunc_u/f32 10 | drop 11 | 12 | f64.const 0 13 | i32.trunc_s/f64 14 | drop 15 | 16 | f64.const 0 17 | i32.trunc_u/f64 18 | drop 19 | 20 | f32.const 0 21 | i64.trunc_s/f32 22 | drop 23 | 24 | f32.const 0 25 | i64.trunc_u/f32 26 | drop 27 | 28 | f64.const 0 29 | i64.trunc_s/f64 30 | drop 31 | 32 | f64.const 0 33 | i64.trunc_u/f64 34 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/CurrentMemory.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (memory 1) 4 | (func 5 | current_memory 6 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Drop.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 0 5 | drop 6 | i64.const 0 7 | drop 8 | f32.const 0 9 | drop 10 | f64.const 0 11 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/ExprBr.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | block $exit (result i32) 5 | i32.const 0 6 | br 0 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/ExprBrif.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | block $exit (result i32) 5 | i32.const 0 6 | i32.const 0 7 | br_if 0 8 | drop 9 | i32.const 1 10 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Getglobal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (global i32 (i32.const 1)) 4 | (func (result i32) 5 | get_global 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/GetglobalNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (global $g i32 (i32.const 1)) 4 | (func (result i32) 5 | get_global $g)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Getlocal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (local i32) 4 | get_local 0 5 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/GetlocalIndexAfterParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param i32) (local i32) 4 | get_local 1 5 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/GetlocalIndexMixedNamedUnnamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param i32) (param $n f32) 4 | (local i32 i64) 5 | (local $m f64) 6 | get_local 0 7 | drop 8 | get_local 1 9 | drop 10 | get_local $n ;; 1 11 | drop 12 | get_local 2 13 | drop 14 | get_local 3 15 | drop 16 | get_local $m ;; 4 17 | drop 18 | get_local 4 19 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/GetlocalNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (local $foo i32) 4 | get_local $foo 5 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/GetlocalParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param i32) 4 | get_local 0 5 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/GetlocalParamNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param $n i32) 4 | get_local $n 5 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/GrowMemory.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (memory 1) 4 | (func 5 | i32.const 100 6 | grow_memory 7 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/If.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 1 5 | if 6 | nop 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/IfMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | ;; if w/ multiple results 4 | (func 5 | i32.const 0 6 | if (result i32 f32 f64) 7 | i32.const 0 8 | f32.const 0 9 | f64.const 0 10 | else 11 | i32.const 1 12 | f32.const 1 13 | f64.const 1 14 | end 15 | return) 16 | 17 | ;; if w/ params 18 | (func 19 | i32.const 1 ;; param 20 | i32.const 0 ;; cond 21 | if (param i32) (result i64) 22 | drop 23 | i64.const 1 24 | else 25 | i64.extend_u/i32 26 | end 27 | return) 28 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/IfReturn.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | i32.const 1 5 | if (result i32) 6 | i32.const 2 7 | return 8 | else 9 | i32.const 3 10 | return 11 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/IfThenBr.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 1 5 | if 6 | br 0 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/IfThenBrNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 1 5 | if $exit 6 | br $exit 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/IfThenElse.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | (i32.const 0) 5 | if 6 | nop 7 | else 8 | nop 9 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/IfThenElseBr.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | i32.const 1 5 | if (result i32) 6 | i32.const 1 7 | br 0 8 | else 9 | i32.const 1 10 | br 0 11 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/IfThenElseBrNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | i32.const 1 5 | if $exit (result i32) 6 | i32.const 1 7 | br $exit 8 | else 9 | i32.const 2 10 | br $exit 11 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/IfThenElseList.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 1 5 | if 6 | nop 7 | nop 8 | else 9 | nop 10 | nop 11 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Loop.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | loop 5 | nop 6 | nop 7 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/LoopMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | ;; loop w/ multiple results 4 | (func 5 | loop (result i32 i64) 6 | i32.const 0 7 | i64.const 0 8 | end 9 | return) 10 | 11 | ;; loop w/ params 12 | (func 13 | i64.const 0 14 | loop (param i64) (result i32) 15 | drop 16 | i32.const 1 17 | end 18 | return) 19 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/LoopMultiNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (type $v_v (func)) 3 | (type $v_ii (func (param i32 i32))) 4 | (type $ii_v (func (result i32 i32))) 5 | (type $ff_ff (func (param f32 f32) (result f32 f32))) 6 | 7 | (func 8 | loop (type $v_v) 9 | end) 10 | 11 | (func 12 | i32.const 1 13 | i32.const 2 14 | loop (type $v_ii) 15 | drop 16 | drop 17 | end) 18 | 19 | (func 20 | loop (type $ii_v) 21 | i32.const 1 22 | i32.const 2 23 | end 24 | drop 25 | drop) 26 | 27 | (func 28 | f32.const 1 29 | f32.const 2 30 | loop (type $ff_ff) 31 | end 32 | drop 33 | drop) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/LoopNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | loop 5 | nop 6 | end 7 | loop $inner 8 | nop 9 | end)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/MemoryCopy.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | (module 4 | (memory 0) 5 | 6 | (func 7 | i32.const 0 8 | i32.const 0 9 | i32.const 0 10 | memory.copy)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/MemoryDrop.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | (module 4 | (memory 0) 5 | 6 | (func 7 | data.drop 0) 8 | 9 | (data "hi")) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/MemoryFill.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | (module 4 | (memory 0) 5 | 6 | (func 7 | i32.const 0 8 | i32.const 0 9 | i32.const 0 10 | memory.fill)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/MemoryInit.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | (module 4 | (memory 0) 5 | 6 | (func 7 | i32.const 0 8 | i32.const 0 9 | i32.const 0 10 | memory.init 0) 11 | 12 | (data "hi")) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Nop.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func nop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/ReferenceTypesCallIndirect.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-reference-types 3 | 4 | (module 5 | (table $foo 1 anyfunc) 6 | (table $bar 1 anyfunc) 7 | 8 | (func (result i32) i32.const 0) 9 | (func (result i32) i32.const 1) 10 | 11 | (func (result i32) 12 | i32.const 0 13 | call_indirect $foo (type 0)) 14 | 15 | (func (result i32) 16 | i32.const 0 17 | call_indirect $bar (type 0)) 18 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/ReferenceTypesNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-reference-types 3 | 4 | (module 5 | (table $foo 1 externref) 6 | (func (result externref) 7 | i32.const 0 8 | table.get $foo 9 | ) 10 | (func (param externref) 11 | i32.const 0 12 | get_local 0 13 | table.set $foo 14 | ) 15 | (func (result i32) 16 | ref.null extern 17 | i32.const 0 18 | table.grow $foo 19 | ) 20 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Return.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | i32.const 42 5 | return)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/ReturnBlock.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | block (result i32) 5 | nop 6 | i32.const 1 7 | end 8 | return)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/ReturnIf.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32) 4 | i32.const 1 5 | if (result i32) 6 | i32.const 2 7 | else 8 | i32.const 3 9 | end 10 | return)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/ReturnVoid.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func return)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Select.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 2 5 | i32.const 3 6 | i32.const 1 7 | select 8 | drop 9 | i64.const 2 10 | i64.const 3 11 | i32.const 1 12 | select 13 | drop 14 | f32.const 2 15 | f32.const 3 16 | i32.const 1 17 | select 18 | drop 19 | f64.const 2 20 | f64.const 3 21 | i32.const 1 22 | select 23 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Setglobal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (global (mut f32) (f32.const 1)) 4 | (func 5 | f32.const 2 6 | set_global 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/SetglobalNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (global $g (mut f32) (f32.const 1)) 4 | (func 5 | f32.const 2 6 | set_global $g)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Setlocal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (local i32) 3 | i32.const 0 4 | set_local 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/SetlocalIndexAfterParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param i32) 4 | (local i32) 5 | i32.const 0 6 | set_local 1)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/SetlocalIndexMixedNamedUnnamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param i32) (param $n f32) 4 | (local i32 i64) 5 | (local $m f64) 6 | i32.const 0 7 | set_local 0 8 | f32.const 0 9 | set_local 1 10 | f32.const 0 11 | set_local $n ;; 1 12 | i32.const 0 13 | set_local 2 14 | i64.const 0 15 | set_local 3 16 | f64.const 0 17 | set_local $m ;; 4 18 | f64.const 0 19 | set_local 4)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/SetlocalNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func 3 | (local $n i32) 4 | i32.const 12 5 | set_local $n)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/SetlocalParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param i32) 4 | i32.const 0 5 | set_local 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/SetlocalParamNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param $n i32) 4 | i32.const 0 5 | set_local $n)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/TableCopy.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | (module 4 | (memory 0) 5 | 6 | (func 7 | i32.const 0 8 | i32.const 0 9 | i32.const 0 10 | table.copy) 11 | 12 | (table 0 anyfunc)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/TableDrop.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | (module 4 | (memory 0) 5 | 6 | (func 7 | elem.drop 0) 8 | 9 | (func) 10 | 11 | (table 0 funcref) 12 | (elem func 1)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/TableGet.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-reference-types 3 | (module 4 | (func (result externref) 5 | i32.const 0 6 | table.get 0) 7 | 8 | (table 1 externref)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/TableGrow.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-reference-types 3 | (module 4 | (func (result i32) 5 | ref.null extern 6 | i32.const 0 7 | table.grow 0) 8 | 9 | (table 1 externref)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/TableInit.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | (module 4 | (memory 0) 5 | 6 | (func 7 | i32.const 0 8 | i32.const 0 9 | i32.const 0 10 | table.init 0) 11 | 12 | (func) 13 | 14 | (table 0 funcref) 15 | (elem func 1)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/TableSet.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-reference-types 3 | (module 4 | (func (param externref) 5 | i32.const 0 6 | get_local 0 7 | table.set 0) 8 | 9 | (table 1 externref)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/TeeLocal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | (local i32) 5 | i32.const 0 6 | tee_local 0 7 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/UnaryExtend.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func 4 | i32.const 0 5 | i32.extend8_s 6 | drop 7 | 8 | i32.const 0 9 | i32.extend16_s 10 | drop 11 | 12 | i64.const 0 13 | i64.extend8_s 14 | drop 15 | 16 | i64.const 0 17 | i64.extend16_s 18 | drop 19 | 20 | i64.const 0 21 | i64.extend32_s 22 | drop)) -------------------------------------------------------------------------------- /src/test/resources/parser/expr/Unreachable.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func unreachable)) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Add.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (func $add (param $lhs i32) (param $rhs i32) (result i32) 3 | local.get $lhs 4 | local.get $rhs 5 | i32.add) 6 | (export "add" (func $add)) 7 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Call.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (func $getAnswer (result i32) 3 | i32.const 42) 4 | (func (export "getAnswerPlus1") (result i32) 5 | call $getAnswer 6 | i32.const 1 7 | i32.add)) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Fail.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (func (export "fail_me") (result i32) 3 | i32.const 1 4 | i32.const 0 5 | i32.div_s)) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Global.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (global $g (import "js" "global") (mut i32)) 3 | (func (export "getGlobal") (result i32) 4 | (global.get $g)) 5 | (func (export "incGlobal") 6 | (global.set $g 7 | (i32.add (global.get $g) (i32.const 1)))) 8 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Logger.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "console" "log" (func $log (param i32))) 3 | (func (export "logIt") 4 | i32.const 13 5 | call $log)) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Logger2.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "console" "log" (func $log (param i32 i32))) 3 | (import "js" "mem" (memory 1)) 4 | (data (i32.const 0) "Hi") 5 | (func (export "writeHi") 6 | i32.const 0 ;; pass offset 0 to log 7 | i32.const 2 ;; pass length 2 to log 8 | call $log)) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Shared0.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "js" "memory" (memory 1)) 3 | (import "js" "table" (table 1 funcref)) 4 | (elem (i32.const 0) $shared0func) 5 | (func $shared0func (result i32) 6 | i32.const 0 7 | i32.load) 8 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Shared1.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "js" "memory" (memory 1)) 3 | (import "js" "table" (table 1 funcref)) 4 | (type $void_to_i32 (func (result i32))) 5 | (func (export "doIt") (result i32) 6 | i32.const 0 7 | i32.const 42 8 | i32.store ;; store 42 at address 0 9 | i32.const 0 10 | call_indirect (type $void_to_i32)) 11 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Simple.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (func $i (import "imports" "imported_func") (param i32)) 3 | (func (export "exported_func") 4 | i32.const 42 5 | call $i)) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Table.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (func $thirteen (result i32) (i32.const 13)) 3 | (func $fourtytwo (result i32) (i32.const 42)) 4 | (table (export "tbl") funcref (elem $thirteen $fourtytwo)) 5 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file/Table2.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "js" "tbl" (table 2 funcref)) 3 | (func $f42 (result i32) i32.const 42) 4 | (func $f83 (result i32) i32.const 83) 5 | (elem (i32.const 0) $f42 $f83) 6 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file/WasmTable.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (table 2 funcref) 3 | (func $f1 (result i32) 4 | i32.const 42) 5 | (func $f2 (result i32) 6 | i32.const 13) 7 | (elem (i32.const 0) $f1 $f2) 8 | (type $return_i32 (func (result i32))) 9 | (func (export "callByIndex") (param $i i32) (result i32) 10 | local.get $i 11 | call_indirect (type $return_i32)) 12 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file_v1.0/Add.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (func $add (param $lhs i32) (param $rhs i32) (result i32) 3 | get_local $lhs 4 | get_local $rhs 5 | i32.add) 6 | (export "add" (func $add)) 7 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file_v1.0/Shared0.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "js" "memory" (memory 1)) 3 | (import "js" "table" (table 1 anyfunc)) 4 | (elem (i32.const 0) $shared0func) 5 | (func $shared0func (result i32) 6 | i32.const 0 7 | i32.load) 8 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file_v1.0/Shared1.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "js" "memory" (memory 1)) 3 | (import "js" "table" (table 1 anyfunc)) 4 | (type $void_to_i32 (func (result i32))) 5 | (func (export "doIt") (result i32) 6 | i32.const 0 7 | i32.const 42 8 | i32.store ;; store 42 at address 0 9 | i32.const 0 10 | call_indirect (type $void_to_i32)) 11 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file_v1.0/Table.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (func $thirteen (result i32) (i32.const 13)) 3 | (func $fourtytwo (result i32) (i32.const 42)) 4 | (table (export "tbl") anyfunc (elem $thirteen $fourtytwo)) 5 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file_v1.0/Table2.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (import "js" "tbl" (table 2 anyfunc)) 3 | (func $f42 (result i32) i32.const 42) 4 | (func $f83 (result i32) i32.const 83) 5 | (elem (i32.const 0) $f42 $f83) 6 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/file_v1.0/WasmTable.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (table 2 anyfunc) 3 | (func $f1 (result i32) 4 | i32.const 42) 5 | (func $f2 (result i32) 6 | i32.const 13) 7 | (elem (i32.const 0) $f1 $f2) 8 | (type $return_i32 (func (result i32))) 9 | (func (export "callByIndex") (param $i i32) (result i32) 10 | get_local $i 11 | call_indirect (type $return_i32)) 12 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadFuncName.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func foo)) 5 | (;; STDERR ;;; 6 | out/test/parse/func/bad-func-name.txt:4:9: error: unexpected token foo, expected ). 7 | (func foo)) 8 | ^^^ 9 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadLocalBinding.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (local $foo $bar))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-local-binding.txt:3:27: error: unexpected token "$bar", expected i32, i64, f32, f64, v128 or externref. 6 | (module (func (local $foo $bar))) 7 | ^^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadLocalBindingNoType.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (local $n))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-local-binding-no-type.txt:3:24: error: unexpected token ")", expected i32, i64, f32, f64, v128 or externref. 6 | (module (func (local $n))) 7 | ^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadLocalName.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (local 0 i32))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-local-name.txt:3:22: error: unexpected token 0, expected ). 6 | (module (func (local 0 i32))) 7 | ^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadLocalType.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (local foo))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-local-type.txt:3:22: error: unexpected token foo, expected ). 6 | (module (func (local foo))) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadLocalTypeList.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (local i32 i64 foo f32))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-local-type-list.txt:3:30: error: unexpected token foo, expected ). 6 | (module (func (local i32 i64 foo f32))) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (param foo))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-param.txt:3:22: error: unexpected token foo, expected ). 6 | (module (func (param foo))) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadParamBinding.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (param $bar $baz))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-param-binding.txt:3:27: error: unexpected token "$baz", expected i32, i64, f32, f64, v128 or externref. 6 | (module (func (param $bar $baz))) 7 | ^^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadParamName.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (param 0 i32))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-param-name.txt:3:22: error: unexpected token 0, expected ). 6 | (module (func (param 0 i32))) 7 | ^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadParamTypeList.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (param i32 i64 foo f32))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-param-type-list.txt:3:30: error: unexpected token foo, expected ). 6 | (module (func (param i32 i64 foo f32))) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/BadResultType.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (result foo))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-result-type.txt:3:23: error: unexpected token foo, expected ). 6 | (module (func (result foo))) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/func/FuncNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func $foo)) -------------------------------------------------------------------------------- /src/test/resources/parser/func/Local.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (local i32))) -------------------------------------------------------------------------------- /src/test/resources/parser/func/LocalEmpty.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (local))) -------------------------------------------------------------------------------- /src/test/resources/parser/func/LocalExnref.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module (func (local externref))) 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/func/LocalMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (local i32) (local $n i64))) -------------------------------------------------------------------------------- /src/test/resources/parser/func/NoSpace.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func $foomore 4 | i32.const 0x0 5 | call $foo) 6 | (func $foo (param i32) nop) 7 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/func/ParamBinding.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (param $foo i32))) -------------------------------------------------------------------------------- /src/test/resources/parser/func/ParamExnref.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module (func (param externref))) 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/func/ParamMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (param i32) (param $n f64))) -------------------------------------------------------------------------------- /src/test/resources/parser/func/ParamType1.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (param i32))) -------------------------------------------------------------------------------- /src/test/resources/parser/func/ParamType2.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (param i32 f32))) -------------------------------------------------------------------------------- /src/test/resources/parser/func/Result.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (result i32) i32.const 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/func/ResultEmpty.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (func (result))) -------------------------------------------------------------------------------- /src/test/resources/parser/func/ResultExnref.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module (func (result externref) ref.null extern)) 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/func/ResultMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (result i32 i32) 4 | i32.const 0 5 | i32.const 1)) -------------------------------------------------------------------------------- /src/test/resources/parser/func/Sig.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (type $t (func (param i32) (result i32))) 4 | (func (type $t) (i32.const 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/func/SigMatch.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (type $empty (func)) 4 | (type $i_v (func (param i32))) 5 | (type $f_i (func (param f32) (result i32))) 6 | (type $ii_i (func (param i32 i32) (result i32))) 7 | (type $v_f (func (result f32))) 8 | 9 | (func (type $empty)) 10 | (func (type $i_v) (param i32)) 11 | (func (type $f_i) (param f32) (result i32) i32.const 0) 12 | (func (type $ii_i) (param i32 i32) (result i32) i32.const 0) 13 | (func (type $v_f) (result f32) f32.const 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/assert-after-module.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | (module 3 | (export "f" (func 0)) 4 | (func (result i32) 5 | i32.const 0 6 | return)) 7 | (assert_return (invoke "f") (i32.const 0)) 8 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/assert-return-arithmetic-nan.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | (module 3 | (func $foo (param f32) (result f32) 4 | get_local 0 5 | f32.const 0 6 | f32.div) 7 | (export "foo" (func $foo))) 8 | 9 | (assert_return (invoke "foo" (f32.const 0)) (f32.const nan:arithmetic)) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/assert-return-canonical-nan.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | (module 3 | (func $foo (param f32) (result f32) 4 | get_local 0 5 | f32.const 0 6 | f32.div) 7 | (export "foo" (func $foo))) 8 | 9 | (assert_return (invoke "foo" (f32.const 0)) (f32.const nan:canonical)) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/assertinvalid-binary-module.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | (assert_invalid (module binary "\00ASM") "bad magic") 3 | (module) 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/assertinvalid.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | (assert_invalid 3 | (module 4 | (func 5 | i32.const 1 6 | drop) 7 | (export "foo" (func 1))) 8 | "unknown function 1") ;; string is ignored 9 | (assert_invalid 10 | (module 11 | (func (result i32) 12 | nop)) 13 | "type mismatch") 14 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/assertmalformed.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | (assert_malformed 3 | (module binary 4 | "\00asm\bc\0a\00\00") 5 | "unknown binary version") 6 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/assertreturn.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | (module 3 | (func $foo (result i32) i32.const 0) 4 | (export "foo" (func $foo)) 5 | (func $bar (param f32) (result f32) 6 | get_local 0) 7 | (export "bar" (func $bar))) 8 | 9 | (assert_return (invoke "foo") (i32.const 0)) 10 | (assert_return (invoke "bar" (f32.const 0)) (f32.const 0)) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/bad-assert-before-module.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | (assert_return (invoke "f") (i32.const 0)) 4 | (;; STDERR ;;; 5 | out/test/parse/assert/bad-assert-before-module.txt:3:17: error: unknown module 6 | (assert_return (invoke "f") (i32.const 0)) 7 | ^^^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/bad-assertreturn-non-const.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | (module 4 | (func $bar (param f32) (result f32) 5 | get_local 0) 6 | (export "bar" (func $bar))) 7 | 8 | ;; NOT ok to use more complex exprs 9 | (assert_return 10 | (invoke "bar" 11 | (f32.add (f32.const 1) (f32.const 10))) 12 | (f32.const 11)) 13 | (;; STDERR ;;; 14 | out/test/parse/assert/bad-assertreturn-non-const.txt:11:5: error: unexpected token (, expected ). 15 | (f32.add (f32.const 1) (f32.const 10))) 16 | ^ 17 | ;;; STDERR ;;) 18 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/bad-assertreturn-too-few.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | (module 4 | (func $foo (param i32) (result i32) 5 | get_local 0) 6 | (export "foo" (func $foo))) 7 | (assert_return (invoke "foo") (i32.const 0)) 8 | (;; STDERR ;;; 9 | out/test/parse/assert/bad-assertreturn-too-few.txt:7:17: error: too few parameters to function. got 0, expected 1 10 | (assert_return (invoke "foo") (i32.const 0)) 11 | ^^^^^^ 12 | ;;; STDERR ;;) 13 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/bad-assertreturn-too-many.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | (module 4 | (func $foo (result i32) 5 | i32.const 0) 6 | (export "foo" (func $foo))) 7 | (assert_return (invoke "foo" (i32.const 0)) (i32.const 0)) 8 | (;; STDERR ;;; 9 | out/test/parse/assert/bad-assertreturn-too-many.txt:7:17: error: too many parameters to function. got 1, expected 0 10 | (assert_return (invoke "foo" (i32.const 0)) (i32.const 0)) 11 | ^^^^^^ 12 | ;;; STDERR ;;) 13 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/bad-assertreturn-unknown-function.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | (module) 4 | (assert_return (invoke "foo") (i32.const 0)) 5 | (;; STDERR ;;; 6 | out/test/parse/assert/bad-assertreturn-unknown-function.txt:4:17: error: unknown function export "foo" 7 | (assert_return (invoke "foo") (i32.const 0)) 8 | ^^^^^^ 9 | ;;; STDERR ;;) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/bad-invoke-no-module.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | (invoke "foo") 4 | (;; STDERR ;;; 5 | out/test/parse/assert/bad-invoke-no-module.txt:3:2: error: unknown module 6 | (invoke "foo") 7 | ^^^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/bad-invoke-too-few.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | (module 4 | (func (param i32)) 5 | (export "foo" (func 0))) 6 | (invoke "foo") 7 | (;; STDERR ;;; 8 | out/test/parse/assert/bad-invoke-too-few.txt:6:2: error: too few parameters to function. got 0, expected 1 9 | (invoke "foo") 10 | ^^^^^^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/bad-invoke-too-many.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | (module 4 | (func (param i32)) 5 | (export "foo" (func 0))) 6 | (invoke "foo" (i32.const 0) (i32.const 1)) 7 | (;; STDERR ;;; 8 | out/test/parse/assert/bad-invoke-too-many.txt:6:2: error: too many parameters to function. got 2, expected 1 9 | (invoke "foo" (i32.const 0) (i32.const 1)) 10 | ^^^^^^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/bad-invoke-unknown-function.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | ;;; ERROR: 1 3 | (module 4 | (export "foo" (func $foo)) 5 | (func $foo)) 6 | 7 | (invoke "bar") 8 | (;; STDERR ;;; 9 | out/test/parse/assert/bad-invoke-unknown-function.txt:7:2: error: unknown function export "bar" 10 | (invoke "bar") 11 | ^^^^^^ 12 | ;;; STDERR ;;) 13 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/assert/invoke.txt: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wast2json 2 | (module 3 | (export "test" (func $test)) 4 | (func $test (param i32) (result i32) 5 | get_local 0 6 | i32.const 100 7 | i32.add)) 8 | 9 | (invoke "test" (i32.const 1)) 10 | (invoke "test" (i32.const 100)) 11 | (invoke "test" (i32.const -30)) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/common_rest/AllFeatures.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/common_rest/AllFeatures.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/common_rest/Annotations.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/common_rest/Annotations.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/common_rest/Annotations.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-annotations 3 | (module 4 | (func (@name "some func") (result i32) 5 | i32.const 42 6 | return) 7 | (@custom section) 8 | (@custom (@nested section)) 9 | (@custom (section) (@with "other") nested-subsections)) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/common_rest/BadAnnotations.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/common_rest/BadAnnotations.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/AtomicDisabled.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/AtomicDisabled.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadConstV128I16x8Overflow.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadConstV128I16x8Overflow.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadConstV128I32x4Overflow.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadConstV128I32x4Overflow.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadConstV128I8x16Overflow.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadConstV128I8x16Overflow.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadConstV128NatOverflow.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadConstV128NatOverflow.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadConstV128NatOverflow.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-simd 3 | ;;; ERROR: 1 4 | (module 5 | (func v128.const i32x4 0x12345678 0x123 4294967296 0xabcd3478)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-const-v128-nat-overflow.txt:5:43: error: invalid literal "4294967296" 8 | (func v128.const i32x4 0x12345678 0x123 4294967296 0xabcd3478)) 9 | ^^^^^^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadConstV128TypeI32Expected.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadConstV128TypeI32Expected.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadSimdShuffleLaneIndexOverflow.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadSimdShuffleLaneIndexOverflow.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadSimdShuffleLaneIndexOverflow2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadSimdShuffleLaneIndexOverflow2.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadSimdShuffleNatExpected.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadSimdShuffleNatExpected.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadSimdShuffleNotEnoughIndices.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadSimdShuffleNotEnoughIndices.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadSimdShuffleNotEnoughIndices.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-simd 3 | ;;; ERROR: 1 4 | (module 5 | (func 6 | v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f 7 | v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155 8 | v8x16.shuffle 1 1 1 1 9 | )) 10 | 11 | (;; STDERR ;;; 12 | out/test/parse/expr/bad-simd-shuffle-not-enough-indices.txt:9:5: error: unexpected token ")", expected a natural number in range [0, 32). 13 | )) 14 | ^ 15 | ;;; STDERR ;;) 16 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadTryMultipleCatch.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadTryMultipleCatch.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadTryNoCatch.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BadTryNoCatch.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BadTryNoCatch.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | ;;; ERROR: 1 4 | (module 5 | (func try nop end) 6 | (func (try (do nop)))) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-try-no-catch.txt:5:17: error: unexpected token end, expected catch. 9 | (func try nop end) 10 | ^^^ 11 | out/test/parse/expr/bad-try-no-catch.txt:6:22: error: unexpected token ), expected (. 12 | (func (try (do nop)))) 13 | ^ 14 | ;;; STDERR ;;) 15 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BrOnExn.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/BrOnExn.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/BrOnExn.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module 4 | (event $e (param i32)) 5 | (func 6 | block $b (result i32) 7 | try 8 | catch 9 | br_on_exn $b $e 10 | drop 11 | end 12 | i32.const 0 13 | end 14 | drop)) 15 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/Const.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/Const.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/Rethrow.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/Rethrow.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/Rethrow.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module 4 | (event $e1) 5 | (func 6 | try 7 | catch 8 | rethrow 9 | end)) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/Simd.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/Simd.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/Simd.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-simd 3 | (module 4 | (func 5 | v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f 6 | v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155 7 | v8x16.shuffle 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 | drop 9 | )) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/TailCall.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/TailCall.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/TailCall.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS0: --enable-tail-call 3 | (module 4 | (table 1 anyfunc) 5 | (func return_call 0) 6 | (func i32.const 0 return_call_indirect) 7 | ) 8 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/TailCallDisabled.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/TailCallDisabled.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/TailCallDisabled.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | 4 | (module 5 | (table 1 anyfunc) 6 | (func return_call 0) 7 | (func i32.const 0 return_call_indirect) 8 | ) 9 | (;; STDERR ;;; 10 | out/test/parse/expr/tail-call-disabled.txt:6:9: error: opcode not allowed: return_call 11 | (func return_call 0) 12 | ^^^^^^^^^^^ 13 | out/test/parse/expr/tail-call-disabled.txt:7:21: error: opcode not allowed: return_call_indirect 14 | (func i32.const 0 return_call_indirect) 15 | ^^^^^^^^^^^^^^^^^^^^ 16 | ;;; STDERR ;;) 17 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/TailCallNamed.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/TailCallNamed.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/TailCallNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS0: --enable-tail-call 3 | (module 4 | (type $t (func)) 5 | (table 1 anyfunc) 6 | (elem (i32.const 0) 0) 7 | (func $f return_call $f) 8 | (func i32.const 0 return_call_indirect (type $t)) 9 | ) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/Throw.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/Throw.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/Throw.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module 4 | (event $e1) 5 | (func throw $e1)) 6 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/Try.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/Try.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/Try.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module 4 | ;; bare 5 | (func 6 | try 7 | nop 8 | catch 9 | drop 10 | end) 11 | 12 | ;; with label 13 | (func 14 | try $foo 15 | nop 16 | catch 17 | drop 18 | end) 19 | 20 | ;; with result type 21 | (func 22 | try (result i32) 23 | i32.const 1 24 | catch 25 | drop 26 | i32.const 2 27 | end 28 | drop)) 29 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/TryMulti.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/TryMulti.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/TryMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module 4 | ;; try w/ multiple results 5 | (func 6 | try (result f32 f32) 7 | f32.const 0 8 | f32.const 1 9 | catch 10 | drop 11 | f32.const 2 12 | f32.const 3 13 | end 14 | return) 15 | 16 | ;; try w/ params 17 | (func 18 | i32.const 0 19 | try (param i32) (result i32) 20 | i32.eqz 21 | catch 22 | drop ;; no i32 param, just exnref 23 | i32.const 0 24 | end 25 | return) 26 | ) 27 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadAtomicUnnaturalAlign.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadAtomicUnnaturalAlign.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBinaryOneExpr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadBinaryOneExpr.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBinaryOneExpr.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | i32.add)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-binary-one-expr.txt:5:4: error: type mismatch in i32.add, expected [i32, i32] but got [i32] 8 | i32.add)) 9 | ^^^^^^^ 10 | out/test/parse/expr/bad-binary-one-expr.txt:5:4: error: type mismatch in function, expected [] but got [i32] 11 | i32.add)) 12 | ^^^^^^^ 13 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBlockEndLabel.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadBlockEndLabel.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBlockEndLabel.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | block 6 | end $foo)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-block-end-label.txt:6:9: error: unexpected label "$foo" 9 | end $foo)) 10 | ^^^^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBlockMismatchLabel.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadBlockMismatchLabel.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBlockMismatchLabel.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | block $foo 6 | end $bar)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-block-mismatch-label.txt:6:9: error: mismatching label "$foo" != "$bar" 9 | end $bar)) 10 | ^^^^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrBadDepth.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadBrBadDepth.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrBadDepth.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func ;; 2 (implicit) 5 | block ;; 1 6 | block ;; 0 7 | br 3 8 | end 9 | end)) 10 | (;; STDERR ;;; 11 | out/test/parse/expr/bad-br-bad-depth.txt:7:9: error: invalid depth: 3 (max 2) 12 | br 3 13 | ^^ 14 | ;;; STDERR ;;) 15 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrDefinedLater.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadBrDefinedLater.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrDefinedLater.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | br 1 6 | block 7 | nop 8 | end)) 9 | (;; STDERR ;;; 10 | out/test/parse/expr/bad-br-defined-later.txt:5:5: error: invalid depth: 1 (max 0) 11 | br 1 12 | ^^ 13 | ;;; STDERR ;;) 14 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrNameUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadBrNameUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrNameUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func br $n)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-br-name-undefined.txt:3:18: error: undefined label variable "$n" 6 | (module (func br $n)) 7 | ^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadBrUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func br 1)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-br-undefined.txt:3:15: error: invalid depth: 1 (max 0) 6 | (module (func br 1)) 7 | ^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrtableBadDepth.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadBrtableBadDepth.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadBrtableBadDepth.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func ;; depth 1 (implicit) 5 | block ;; depth 0 6 | i32.const 0 7 | br_table 2 8 | end)) 9 | (;; STDERR ;;; 10 | out/test/parse/expr/bad-brtable-bad-depth.txt:7:7: error: invalid depth: 2 (max 1) 11 | br_table 2 12 | ^^^^^^^^ 13 | ;;; STDERR ;;) 14 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadCompareOneExpr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadCompareOneExpr.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadCompareOneExpr.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | i32.lt_s)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-compare-one-expr.txt:5:11: error: type mismatch in i32.lt_s, expected [i32, i32] but got [i32] 8 | i32.lt_s)) 9 | ^^^^^^^^ 10 | out/test/parse/expr/bad-compare-one-expr.txt:5:11: error: type mismatch in function, expected [] but got [i32] 11 | i32.lt_s)) 12 | ^^^^^^^^ 13 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadConstI32Overflow.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadConstI32Overflow.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadConstI32Overflow.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func i32.const 4294967296)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-const-i32-overflow.txt:3:25: error: invalid literal "4294967296" 6 | (module (func i32.const 4294967296)) 7 | ^^^^^^^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadConstI32Underflow.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadConstI32Underflow.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadConstI32Underflow.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func i32.const -2147483649)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-const-i32-underflow.txt:3:25: error: invalid literal "-2147483649" 6 | (module (func i32.const -2147483649)) 7 | ^^^^^^^^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadConstI64Overflow.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadConstI64Overflow.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadConstI64Overflow.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func i64.const 18446744073709551616)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-const-i64-overflow.txt:3:25: error: invalid literal "18446744073709551616" 6 | (module (func i64.const 18446744073709551616)) 7 | ^^^^^^^^^^^^^^^^^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadGetglobalNameUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadGetglobalNameUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadGetglobalNameUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func get_global $n)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-getglobal-name-undefined.txt:3:26: error: undefined global variable "$n" 6 | (module (func get_global $n)) 7 | ^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadGetglobalUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadGetglobalUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadGetglobalUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | get_global 0 6 | drop)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-getglobal-undefined.txt:5:16: error: global variable out of range: 0 (max 0) 9 | get_global 0 10 | ^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadGetlocalNameUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadGetlocalNameUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadGetlocalNameUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func get_local $n)) 4 | (;; STDERR ;;; 5 | out/test/parse/expr/bad-getlocal-name-undefined.txt:3:25: error: undefined local variable "$n" 6 | (module (func get_local $n)) 7 | ^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadGetlocalUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadGetlocalUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadGetlocalUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | get_local 0 6 | drop)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-getlocal-undefined.txt:5:15: error: local variable out of range (max 0) 9 | get_local 0 10 | ^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadIfEndLabel.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadIfEndLabel.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadIfEndLabel.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | i32.const 0 6 | if 7 | else $foo 8 | end $bar)) 9 | (;; STDERR ;;; 10 | out/test/parse/expr/bad-if-end-label.txt:7:10: error: unexpected label "$foo" 11 | else $foo 12 | ^^^^ 13 | out/test/parse/expr/bad-if-end-label.txt:8:9: error: unexpected label "$bar" 14 | end $bar)) 15 | ^^^^ 16 | ;;; STDERR ;;) 17 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadIfMismatchLabel.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadIfMismatchLabel.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadIfMismatchLabel.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | i32.const 1 6 | if $foo 7 | else $bar 8 | end $baz)) 9 | (;; STDERR ;;; 10 | out/test/parse/expr/bad-if-mismatch-label.txt:7:10: error: mismatching label "$foo" != "$bar" 11 | else $bar 12 | ^^^^ 13 | out/test/parse/expr/bad-if-mismatch-label.txt:8:9: error: mismatching label "$foo" != "$baz" 14 | end $baz)) 15 | ^^^^ 16 | ;;; STDERR ;;) 17 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadLoadAlignNotPot.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadLoadAlignNotPot.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadLoadAlignNotPot.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (memory 1) 5 | (func 6 | i32.const 0 7 | i32.load align=3 8 | drop)) 9 | (;; STDERR ;;; 10 | out/test/parse/expr/bad-load-align-not-pot.txt:7:14: error: alignment must be power-of-two 11 | i32.load align=3 12 | ^^^^^^^ 13 | ;;; STDERR ;;) 14 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadLoopEndLabel.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadLoopEndLabel.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadLoopEndLabel.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | loop 6 | end $foo)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-loop-end-label.txt:6:9: error: unexpected label "$foo" 9 | end $foo)) 10 | ^^^^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadLoopMismatchLabel.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadLoopMismatchLabel.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadLoopMismatchLabel.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | loop $foo 6 | end $bar)) 7 | (;; STDERR ;;; 8 | out/test/parse/expr/bad-loop-mismatch-label.txt:6:9: error: mismatching label "$foo" != "$bar" 9 | end $bar)) 10 | ^^^^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetglobalNameUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadSetglobalNameUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetglobalNameUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 1 5 | set_global $f)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-setglobal-name-undefined.txt:5:22: error: undefined global variable "$f" 8 | set_global $f)) 9 | ^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetglobalUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadSetglobalUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetglobalUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 1 5 | set_global 0)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-setglobal-undefined.txt:5:22: error: global variable out of range: 0 (max 0) 8 | set_global 0)) 9 | ^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetlocalNameUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadSetlocalNameUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetlocalNameUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | set_local $n)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-setlocal-name-undefined.txt:5:21: error: undefined local variable "$n" 8 | set_local $n)) 9 | ^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetlocalNoValue.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadSetlocalNoValue.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetlocalNoValue.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | (local i32) 5 | set_local 0)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-setlocal-no-value.txt:5:3: error: type mismatch in local.set, expected [i32] but got [] 8 | set_local 0)) 9 | ^^^^^^^^^ 10 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetlocalUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadSetlocalUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadSetlocalUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func 4 | i32.const 0 5 | set_local 0)) 6 | (;; STDERR ;;; 7 | out/test/parse/expr/bad-setlocal-undefined.txt:5:21: error: local variable out of range (max 0) 8 | set_local 0)) 9 | ^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadStoreAlignNotPot.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/BadStoreAlignNotPot.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/BadStoreAlignNotPot.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (memory 1) 5 | (func 6 | i32.const 0 7 | f32.const 0.0 8 | f32.store align=3)) 9 | (;; STDERR ;;; 10 | out/test/parse/expr/bad-store-align-not-pot.txt:8:15: error: alignment must be power-of-two 11 | f32.store align=3)) 12 | ^^^^^^^ 13 | ;;; STDERR ;;) 14 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/CallimportDefinedLater.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/expr_rest/semantic/CallimportDefinedLater.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/expr_rest/semantic/CallimportDefinedLater.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func 5 | f32.const 0 6 | call $baz) 7 | (import "foo" "bar" (func $baz (param f32)))) 8 | (;; STDERR ;;; 9 | out/test/parse/expr/callimport-defined-later.txt:7:4: error: imports must occur before all non-import definitions 10 | (import "foo" "bar" (func $baz (param f32)))) 11 | ^^^^^^ 12 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadLocalRedefinition.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/func_rest/semantic/BadLocalRedefinition.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadLocalRedefinition.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (param $n i32) (local $n f32))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-local-redefinition.txt:3:37: error: redefinition of parameter "$n" 6 | (module (func (param $n i32) (local $n f32))) 7 | ^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadParamRedefinition.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/func_rest/semantic/BadParamRedefinition.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadParamRedefinition.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (param $n i32) (param $n f32))) 4 | (;; STDERR ;;; 5 | out/test/parse/func/bad-param-redefinition.txt:3:37: error: redefinition of parameter "$n" 6 | (module (func (param $n i32) (param $n f32))) 7 | ^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigParamTypeMismatch.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/func_rest/semantic/BadSigParamTypeMismatch.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigParamTypeMismatch.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (type $t (func (param i32 f32))) 5 | (func (type $t) (param f32 f32))) 6 | (;; STDERR ;;; 7 | out/test/parse/func/bad-sig-param-type-mismatch.txt:5:4: error: type mismatch for argument 0 of function. got f32, expected i32 8 | (func (type $t) (param f32 f32))) 9 | ^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigParamsEmpty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/func_rest/semantic/BadSigParamsEmpty.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigParamsEmpty.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (type $t (func)) 5 | (func (type $t) (param i32))) 6 | (;; STDERR ;;; 7 | out/test/parse/func/bad-sig-params-empty.txt:5:4: error: expected 0 arguments, got 1 8 | (func (type $t) (param i32))) 9 | ^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigResultTypeMismatch.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/func_rest/semantic/BadSigResultTypeMismatch.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigResultTypeMismatch.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (type $t (func (param i32) (result f32))) 5 | (func (type $t) (param i32) (result i64))) 6 | (;; STDERR ;;; 7 | out/test/parse/func/bad-sig-result-type-mismatch.txt:5:4: error: type mismatch for result 0 of function. got i64, expected f32 8 | (func (type $t) (param i32) (result i64))) 9 | ^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigResultTypeNotVoid.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/func_rest/semantic/BadSigResultTypeNotVoid.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigResultTypeNotVoid.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (type $t (func (param i32))) 5 | (func (type $t) (param i32) (result f32))) 6 | (;; STDERR ;;; 7 | out/test/parse/func/bad-sig-result-type-not-void.txt:5:4: error: expected 0 results, got 1 8 | (func (type $t) (param i32) (result f32))) 9 | ^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigResultTypeVoid.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/func_rest/semantic/BadSigResultTypeVoid.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigResultTypeVoid.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (type $t (func (param i32) (result f32))) 5 | (func (type $t) (param i32))) 6 | (;; STDERR ;;; 7 | out/test/parse/func/bad-sig-result-type-void.txt:5:4: error: expected 1 results, got 0 8 | (func (type $t) (param i32))) 9 | ^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigTooFewParams.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/func_rest/semantic/BadSigTooFewParams.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigTooFewParams.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (type $t (func (param i32 f32))) 5 | (func (type $t) (param i32))) 6 | (;; STDERR ;;; 7 | out/test/parse/func/bad-sig-too-few-params.txt:5:4: error: expected 2 arguments, got 1 8 | (func (type $t) (param i32))) 9 | ^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigTooManyParams.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/func_rest/semantic/BadSigTooManyParams.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/func_rest/semantic/BadSigTooManyParams.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (type $t (func (param i32))) 5 | (func (type $t) (param i32 i32))) 6 | (;; STDERR ;;; 7 | out/test/parse/func/bad-sig-too-many-params.txt:5:4: error: expected 1 arguments, got 2 8 | (func (type $t) (param i32 i32))) 9 | ^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/Array.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/Array.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/Array.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-gc 3 | (type (array i32)) 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/ArrayMutField.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/ArrayMutField.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/ArrayMutField.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-gc 3 | (type (array (mut f32))) 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadArrayNoFields.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/BadArrayNoFields.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadArrayNoFields.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-gc 3 | ;;; ERROR: 1 4 | (type (array)) 5 | (;; STDERR ;;; 6 | out/test/parse/module/bad-array-no-fields.txt:4:13: error: unexpected token ")", expected i32, i64, f32, f64, v128 or externref. 7 | (type (array)) 8 | ^ 9 | ;;; STDERR ;;) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadArrayTooManyFields.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/BadArrayTooManyFields.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadArrayTooManyFields.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-gc 3 | ;;; ERROR: 1 4 | (type (array i32 i32)) 5 | (;; STDERR ;;; 6 | out/test/parse/module/bad-array-too-many-fields.txt:4:18: error: unexpected token i32, expected ). 7 | (type (array i32 i32)) 8 | ^^^ 9 | ;;; STDERR ;;) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadBinaryModuleMagic.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/BadBinaryModuleMagic.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadBinaryModuleMagic.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module binary 4 | "\00ASM" 5 | "\0b\00\00\00") 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-binary-module-magic.txt:3:2: error: error in binary module: @0x00000004: bad magic value 8 | (module binary 9 | ^^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadImportTableShared.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/BadImportTableShared.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadImportTableShared.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (import "foo" "bar" (table 0 3 shared anyfunc)) 5 | ) 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-import-table-shared.txt:4:4: error: tables may not be shared 8 | (import "foo" "bar" (table 0 3 shared anyfunc)) 9 | ^^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadMemorySharedNomax.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/BadMemorySharedNomax.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadMemorySharedNomax.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-threads 3 | ;;; ERROR: 1 4 | (module (memory 1 shared)) 5 | 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-memory-shared-nomax.txt:4:10: error: shared memories must have max sizes 8 | (module (memory 1 shared)) 9 | ^^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadModuleWithAssert.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/BadModuleWithAssert.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BadModuleWithAssert.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func (export "f"))) 4 | 5 | ;; Can't use assert_return when parsing a .wat file. 6 | (assert_return (invoke "f")) 7 | (;; STDERR ;;; 8 | out/test/parse/module/bad-module-with-assert.txt:6:1: error: unexpected token (, expected EOF. 9 | (assert_return (invoke "f")) 10 | ^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/BinaryModule.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/BinaryModule.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/Event.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/Event.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/Event.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module 4 | (type $t (func (param f64))) 5 | (event) 6 | (event $e1 (param i32)) 7 | (event $e2 (param f32 f32 f32)) 8 | (event $e3 (type $t))) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/ExportEvent.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/ExportEvent.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/ExportEvent.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module 4 | (event (param i32 i32)) 5 | (export "my_event" (event 0))) 6 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/ImportEvent.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/ImportEvent.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/ImportEvent.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module 4 | (import "foo" "1" (event (param f64 f32)))) 5 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/ImportMemoryShared.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/ImportMemoryShared.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/ImportMemoryShared.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-threads 3 | (module 4 | (import "foo" "2" (memory 0 2 shared))) 5 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/MemoryShared.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/MemoryShared.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/MemoryShared.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-threads 3 | (module (memory 1 1 shared)) 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/Struct.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/Struct.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/Struct.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-gc 3 | (type (struct i32 (field i64))) 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/StructAndFunc.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/StructAndFunc.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/StructAndFunc.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-gc 3 | (type (struct i32 i32)) 4 | (type (func (result i32))) 5 | 6 | (func (result i32) 7 | i32.const 0) 8 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/StructFieldName.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/StructFieldName.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/StructFieldName.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-gc 3 | (type 4 | (struct (field $a f32) 5 | (field $b (mut f64)))) 6 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/StructMutField.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/StructMutField.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/StructMutField.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-gc 3 | (type (struct (mut f32) (field (mut f64)))) 4 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportFuncNameUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadExportFuncNameUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportFuncNameUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (export "foo" (func $foo))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-func-name-undefined.txt:3:29: error: undefined function variable "$foo" 6 | (module (export "foo" (func $foo))) 7 | ^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportFuncUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadExportFuncUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportFuncUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (export "foo" (func 0))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-func-undefined.txt:3:29: error: function variable out of range: 0 (max 0) 6 | (module (export "foo" (func 0))) 7 | ^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportGlobalNameUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadExportGlobalNameUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportGlobalNameUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (export "foo" (global $bar))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-global-name-undefined.txt:3:31: error: undefined global variable "$bar" 6 | (module (export "foo" (global $bar))) 7 | ^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportGlobalUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadExportGlobalUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportGlobalUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (export "foo" (global 0))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-global-undefined.txt:3:31: error: global variable out of range: 0 (max 0) 6 | (module (export "foo" (global 0))) 7 | ^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportMemoryNameUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadExportMemoryNameUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportMemoryNameUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (export "foo" (memory $bar))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-memory-name-undefined.txt:3:31: error: undefined memory variable "$bar" 6 | (module (export "foo" (memory $bar))) 7 | ^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportMemoryUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadExportMemoryUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportMemoryUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (export "mem" (memory 0))) 5 | (;; STDERR ;;; 6 | out/test/parse/module/bad-export-memory-undefined.txt:4:25: error: memory variable out of range: 0 (max 0) 7 | (export "mem" (memory 0))) 8 | ^ 9 | ;;; STDERR ;;) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportTableNameUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadExportTableNameUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportTableNameUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (export "foo" (table $bar))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-table-name-undefined.txt:3:30: error: undefined table variable "$bar" 6 | (module (export "foo" (table $bar))) 7 | ^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportTableUndefined.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadExportTableUndefined.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadExportTableUndefined.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (export "foo" (table 0))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-table-undefined.txt:3:30: error: table variable out of range: 0 (max 0) 6 | (module (export "foo" (table 0))) 7 | ^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadFuncRedefinition.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadFuncRedefinition.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadFuncRedefinition.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func $n nop) 5 | (func $n nop)) 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-func-redefinition.txt:5:4: error: redefinition of function "$n" 8 | (func $n nop)) 9 | ^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadGlobalInvalidExpr.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadGlobalInvalidExpr.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadGlobalInvalidExpr.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (global i32 5 | i32.const 1 6 | i32.const 2 7 | i32.add)) 8 | (;; STDERR ;;; 9 | out/test/parse/module/bad-global-invalid-expr.txt:4:4: error: invalid global initializer expression, must be a constant expression 10 | (global i32 11 | ^^^^^^ 12 | ;;; STDERR ;;) 13 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadGlobalInvalidGetglobal.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadGlobalInvalidGetglobal.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadGlobalInvalidGetglobal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (global i32 (get_global 1))) 5 | (;; STDERR ;;; 6 | out/test/parse/module/bad-global-invalid-getglobal.txt:4:27: error: global variable out of range: 1 (max 1) 7 | (global i32 (get_global 1))) 8 | ^ 9 | ;;; STDERR ;;) 10 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadImportFuncRedefinition.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadImportFuncRedefinition.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadImportFuncRedefinition.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (import "bar" "baz" (func $foo (param i32))) 5 | (import "quux" "blorf" (func $foo (param f32)))) 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-import-func-redefinition.txt:5:4: error: redefinition of function "$foo" 8 | (import "quux" "blorf" (func $foo (param f32)))) 9 | ^^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadImportGlobalRedefinition.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadImportGlobalRedefinition.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadImportGlobalRedefinition.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (import "foo" "bar" (global $baz i32)) 5 | (import "oof" "rab" (global $baz i32))) 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-import-global-redefinition.txt:5:4: error: redefinition of global "$baz" 8 | (import "oof" "rab" (global $baz i32))) 9 | ^^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadImportMemoryRedefinition.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadImportMemoryRedefinition.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadImportMemoryRedefinition.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (import "foo" "bar" (memory $baz 0)) 5 | (import "foo" "blah" (memory $baz 0))) 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-import-memory-redefinition.txt:5:4: error: redefinition of memory "$baz" 8 | (import "foo" "blah" (memory $baz 0))) 9 | ^^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadImportTableRedefinition.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadImportTableRedefinition.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadImportTableRedefinition.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (import "foo" "bar" (table $baz 0 anyfunc)) 5 | (import "foo" "blah" (table $baz 0 anyfunc))) 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-import-table-redefinition.txt:5:4: error: redefinition of table "$baz" 8 | (import "foo" "blah" (table $baz 0 anyfunc))) 9 | ^^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryInitSizeTooBig.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryInitSizeTooBig.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryInitSizeTooBig.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (memory 65537)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-memory-init-size-too-big.txt:3:10: error: initial pages (65537) must be <= (65536) 6 | (module (memory 65537)) 7 | ^^^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryMaxLessThanInit.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryMaxLessThanInit.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryMaxLessThanInit.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (memory 2 1)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-memory-max-less-than-init.txt:3:10: error: max pages (1) must be >= initial pages (2) 6 | (module (memory 2 1)) 7 | ^^^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryMaxSizeTooBig.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryMaxSizeTooBig.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryMaxSizeTooBig.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (memory 0 65537)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-memory-max-size-too-big.txt:3:10: error: max pages (65537) must be <= (65536) 6 | (module (memory 0 65537)) 7 | ^^^^^^ 8 | ;;; STDERR ;;) 9 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryTooMany.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryTooMany.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadMemoryTooMany.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (memory 1) 5 | (memory 2)) 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-memory-too-many.txt:5:4: error: only one memory block allowed 8 | (memory 2)) 9 | ^^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadModuleMulti.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadModuleMulti.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadModuleMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func)) 4 | 5 | ;; Can't have two modules in a .wat file. 6 | (module) 7 | (;; STDERR ;;; 8 | out/test/parse/module/bad-module-multi.txt:6:1: error: unexpected token (, expected EOF. 9 | (module) 10 | ^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadStartNotNullary.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadStartNotNullary.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadStartNotNullary.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (start 0) 5 | (func (param i32))) 6 | (;; STDERR ;;; 7 | out/test/parse/module/bad-start-not-nullary.txt:4:4: error: start function must be nullary 8 | (start 0) 9 | ^^^^^ 10 | ;;; STDERR ;;) 11 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadStartNotVoid.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadStartNotVoid.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadStartNotVoid.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (start 0) 5 | (func (result i32) 6 | i32.const 0)) 7 | (;; STDERR ;;; 8 | out/test/parse/module/bad-start-not-void.txt:4:4: error: start function must not return anything 9 | (start 0) 10 | ^^^^^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadStartTooMany.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadStartTooMany.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadStartTooMany.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (start 0) 5 | (start 1) 6 | (func) 7 | (func)) 8 | (;; STDERR ;;; 9 | out/test/parse/module/bad-start-too-many.txt:5:4: error: multiple start sections 10 | (start 1) 11 | ^^^^^ 12 | ;;; STDERR ;;) 13 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadTableInvalidFunction.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadTableInvalidFunction.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadTableInvalidFunction.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (table 1 anyfunc) 5 | (func $f) 6 | (elem (i32.const 0) $f 1)) 7 | (;; STDERR ;;; 8 | out/test/parse/module/bad-table-invalid-function.txt:6:26: error: function variable out of range: 1 (max 1) 9 | (elem (i32.const 0) $f 1)) 10 | ^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadTableTooMany.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/future_tests/module_rest/semantic/BadTableTooMany.txt -------------------------------------------------------------------------------- /src/test/resources/parser/future_tests/module_rest/semantic/BadTableTooMany.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (func (param i32)) 5 | (table anyfunc (elem 0)) 6 | (table anyfunc (elem 0))) 7 | (;; STDERR ;;; 8 | out/test/parse/module/bad-table-too-many.txt:6:4: error: only one table allowed 9 | (table anyfunc (elem 0))) 10 | ^^^^^ 11 | ;;; STDERR ;;) 12 | -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadElemRedefinition.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | ;;; ERROR: 1 4 | (module 5 | (elem $elem funcref 0) 6 | (elem $elem funcref 0) 7 | (func)) 8 | 9 | (;; STDERR ;;; 10 | out/test/parse/module/bad-elem-redefinition.txt:5:23: error: unexpected token 0, expected ). 11 | (elem $elem funcref 0) 12 | ^ 13 | out/test/parse/module/bad-elem-redefinition.txt:6:23: error: unexpected token 0, expected ). 14 | (elem $elem funcref 0) 15 | ^ 16 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadExportFuncEmpty.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (export)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-func-empty.txt:3:16: error: unexpected token ")", expected a quoted string (e.g. "foo"). 6 | (module (export)) 7 | ^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadExportFuncName.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (export "foo" (func foo))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-func-name.txt:3:29: error: unexpected token "foo", expected a numeric index or a name (e.g. 12 or $foo). 6 | (module (export "foo" (func foo))) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadExportFuncNoString.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/module/BadExportFuncNoString.txt -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadExportFuncNoString.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func nop) (export nop nop)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-func-no-string.txt:3:28: error: unexpected token "nop", expected a quoted string (e.g. "foo"). 6 | (module (func nop) (export nop nop)) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadExportFuncTooMany.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (func nop) (export "nop" (func 0 foo))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-export-func-too-many.txt:3:42: error: unexpected token foo, expected ). 6 | (module (func nop) (export "nop" (func 0 foo))) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadImportFuncNotParam.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/module/BadImportFuncNotParam.txt -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadImportFuncNotParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (import "foo" "bar" (func (parump i32)))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-import-func-not-param.txt:3:36: error: unexpected token "parump", expected param or result. 6 | (module (import "foo" "bar" (func (parump i32)))) 7 | ^^^^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadImportFuncNotResult.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/module/BadImportFuncNotResult.txt -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadImportFuncNotResult.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (import "foo" "bar" (func (param i32) (resalt i32)))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-import-func-not-result.txt:3:48: error: unexpected token "resalt", expected param or result. 6 | (module (import "foo" "bar" (func (param i32) (resalt i32)))) 7 | ^^^^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadImportFuncOneString.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluralia/web-assembly-plugin/8d2fa2dd6c95e695b94f9884d7a9d6e49d6d8057/src/test/resources/parser/module/BadImportFuncOneString.txt -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadImportFuncOneString.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (import "foo" (param i32))) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-import-func-one-string.txt:3:23: error: unexpected token "(", expected a quoted string (e.g. "foo"). 6 | (module (import "foo" (param i32))) 7 | ^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadMemoryEmpty.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (memory)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-memory-empty.txt:3:16: error: unexpected token ")", expected a natural number (e.g. 123). 6 | (module (memory)) 7 | ^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadMemoryInitSize.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (memory foo)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-memory-init-size.txt:3:17: error: unexpected token "foo", expected a natural number (e.g. 123). 6 | (module (memory foo)) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadMemoryInitSizeNegative.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (memory -100)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-memory-init-size-negative.txt:3:17: error: unexpected token "-100", expected a natural number (e.g. 123). 6 | (module (memory -100)) 7 | ^^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadMemoryMaxSize.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (memory 100 foo)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-memory-max-size.txt:3:21: error: unexpected token foo, expected ). 6 | (module (memory 100 foo)) 7 | ^^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadMemoryMaxSizeNegative.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module (memory 100 -5)) 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-memory-max-size-negative.txt:3:21: error: unexpected token -5, expected ). 6 | (module (memory 100 -5)) 7 | ^^ 8 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadMemorySegmentAddress.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | ;;; ARGS: --enable-bulk-memory 4 | (module 5 | (memory 100) 6 | (data foo)) 7 | (;; STDERR ;;; 8 | out/test/parse/module/bad-memory-segment-address.txt:6:9: error: unexpected token foo, expected ). 9 | (data foo)) 10 | ^^^ 11 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadModuleNoClose.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (;; STDERR ;;; 5 | out/test/parse/module/bad-module-no-close.txt:4:1: error: unexpected token "EOF", expected a module field. 6 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/BadTableElem.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ERROR: 1 3 | (module 4 | (table funcref (elem garbage))) 5 | (;; STDERR ;;; 6 | out/test/parse/module/bad-table-elem.txt:4:24: error: unexpected token garbage, expected ). 7 | (table funcref (elem garbage))) 8 | ^^^^^^^ 9 | ;;; STDERR ;;) -------------------------------------------------------------------------------- /src/test/resources/parser/module/DataOffset.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (import "foo" "bar" (global i32)) 4 | (memory 1) 5 | (global i32 i32.const 1) 6 | (data (get_global 0) "hi")) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ElemOffset.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (import "foo" "bar" (global i32)) 4 | (global i32 i32.const 1) 5 | (func) 6 | (table 2 anyfunc) 7 | (elem (get_global 0) 0)) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ExportFunc.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (nop)) 4 | (export "nop" (func 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ExportFuncMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (nop)) 4 | (export "a" (func 0)) 5 | (export "b" (func 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ExportFuncNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func $n (result i32) (i32.const 0)) 4 | (export "n" (func $n))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ExportGlobal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (global i32 (i32.const 0)) 4 | (global (mut f32) (f32.const 0)) 5 | (export "global0" (global 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ExportMemory.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (memory 1) 4 | (export "mem" (memory 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ExportMemoryInline.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (memory (export "mem") 1) 3 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ExportMemoryInlineSeveral.wat: -------------------------------------------------------------------------------- 1 | (module 2 | (memory (export "mem") (export "mem2") (export "mem3") 1) 3 | ) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ExportMemoryMulti.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (memory 1) 4 | (export "mem1" (memory 0)) 5 | (export "mem2" (memory 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ExportTable.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (table 0 anyfunc) 4 | (export "my_table" (table 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/GlobalExnref.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-exceptions 3 | (module (global externref (ref.null extern))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ImportFunc.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | ;; unnamed 4 | (import "foo" "bar" (func (param i32) (result i64))) 5 | 6 | ;; named 7 | (import "stdio" "print" (func $print_i32 (param i32))) 8 | (import "math" "add" (func $add_i32 (param i32 i32) (result i32))) 9 | (import "test" "f32" (func $f32 (param f32) (result f32))) 10 | (import "test" "f64" (func $f64 (param f64) (result f64))) 11 | (import "test" "i64" (func $i64 (param i64) (result i64)))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ImportFuncNoParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (import "foo" "bar" (func))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ImportFuncType.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (type (func (param i32 i64 f32 f64) (result i32))) 4 | (import "foo" "bar" (func (type 0)))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ImportGlobal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (import "foo" "1" (global i32)) 4 | (import "foo" "2" (global i64)) 5 | (import "foo" "3" (global f32)) 6 | (import "foo" "4" (global f64))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ImportGlobalGetglobal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (import "a" "global" (global i32)) 4 | (global i32 (get_global 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ImportMemory.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (import "foo" "2" (memory 0 2))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ImportMutableGlobal.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (import "mod" "field" (global (mut f32)))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ImportTable.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (import "foo" "2" (table 0 10 anyfunc))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/MemoryInitMaxSize.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (memory 1 2)) -------------------------------------------------------------------------------- /src/test/resources/parser/module/MemoryInitSize.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (memory 1)) -------------------------------------------------------------------------------- /src/test/resources/parser/module/MemorySegment1.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (memory (data "hello, world!"))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/MemorySegmentMany.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (memory 1) 4 | (data (i32.const 0) "hi") 5 | (data (i32.const 4) "hello") 6 | (data (i32.const 10) "goodbye") 7 | (data (i32.const 20) "adios")) -------------------------------------------------------------------------------- /src/test/resources/parser/module/MemorySegmentMultiString.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (memory 4 | (data "hi" "there" "how" "are" "you"))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/MemorySegmentPassive.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | ;;; ARGS: --enable-bulk-memory 3 | (module 4 | (memory 1) 5 | (data "hi")) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ModuleEmpty.txt: -------------------------------------------------------------------------------- 1 | WebAssembly File(0,27) 2 | PsiComment(WebAssemblyToken.LINE_COMMENT)(';;; TOOL: wat2wasm')(0,18) 3 | PsiWhiteSpace('\n')(18,19) 4 | WebAssemblyModuleImpl(MODULE)(19,27) 5 | PsiElement(WebAssemblyToken.LPAR)('(')(19,20) 6 | PsiElement(WebAssemblyToken.MODULEKEY)('module')(20,26) 7 | PsiElement(WebAssemblyToken.RPAR)(')')(26,27) -------------------------------------------------------------------------------- /src/test/resources/parser/module/ModuleEmpty.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module) -------------------------------------------------------------------------------- /src/test/resources/parser/module/Start.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (start 0) 4 | (func)) -------------------------------------------------------------------------------- /src/test/resources/parser/module/StartNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (start $foo) 4 | (func $foo)) -------------------------------------------------------------------------------- /src/test/resources/parser/module/Table.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func (param i32)) 4 | (func (param i32 i64)) 5 | (func (result i64) i64.const 0) 6 | (table anyfunc (elem 0 0 1 2))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/TableElemExpr.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func) 4 | (func) 5 | (table funcref (elem (ref.func 1) (ref.func 0)))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/TableElemVar.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func) 4 | (func) 5 | (table funcref (elem 0 1 0))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/TableNamed.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module 3 | (func $f (param i32)) 4 | (func $g (param i32 i64)) 5 | (func $h (result i64) (i64.const 0)) 6 | (table anyfunc (elem $f $f $g $h))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/Type.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (type (func (param i32) (result i32)))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/TypeEmpty.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (type (func))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/TypeEmptyParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (type (func (param)))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/TypeMultiParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (type (func (param i32 f32 f64) (result f32)))) -------------------------------------------------------------------------------- /src/test/resources/parser/module/TypeNoParam.wat: -------------------------------------------------------------------------------- 1 | ;;; TOOL: wat2wasm 2 | (module (type (func (result i32)))) --------------------------------------------------------------------------------