diff options
Diffstat (limited to 'src/parser/contexts.h')
-rw-r--r-- | src/parser/contexts.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/parser/contexts.h b/src/parser/contexts.h index c1ccefe53..507a54342 100644 --- a/src/parser/contexts.h +++ b/src/parser/contexts.h @@ -589,6 +589,7 @@ struct ParseDeclsCtx : NullTypeParserCtx, NullInstrParserCtx { std::vector<DefPos> tableDefs; std::vector<DefPos> memoryDefs; std::vector<DefPos> globalDefs; + std::vector<DefPos> startDefs; std::vector<DefPos> elemDefs; std::vector<DefPos> dataDefs; std::vector<DefPos> tagDefs; @@ -715,6 +716,14 @@ struct ParseDeclsCtx : NullTypeParserCtx, NullInstrParserCtx { std::optional<ExprT>, Index pos); + Result<> addStart(FuncIdxT, Index pos) { + if (!startDefs.empty()) { + return Err{"unexpected extra 'start' function"}; + } + startDefs.push_back({{}, pos, 0}); + return Ok{}; + } + Result<> addElem(Name, TableIdxT*, std::optional<ExprT>, ElemListT&&, Index); Result<> addDeclareElem(Name, ElemListT&&, Index) { return Ok{}; } @@ -1325,6 +1334,11 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx> { std::optional<ExprT> exp, Index); + Result<> addStart(Name name, Index pos) { + wasm.start = name; + return Ok{}; + } + Result<> addImplicitElems(Type type, std::vector<Expression*>&& elems); Result<> addDeclareElem(Name, std::vector<Expression*>&&, Index) { |