summaryrefslogtreecommitdiff
path: root/src/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/contexts.h12
-rw-r--r--src/parser/parsers.h15
2 files changed, 27 insertions, 0 deletions
diff --git a/src/parser/contexts.h b/src/parser/contexts.h
index 4c15c0308..08cebe33b 100644
--- a/src/parser/contexts.h
+++ b/src/parser/contexts.h
@@ -808,6 +808,11 @@ struct NullInstrParserCtx {
return Ok{};
}
template<typename HeapTypeT>
+ Result<>
+ makeContBind(Index, const std::vector<Annotation>&, HeapTypeT, HeapTypeT) {
+ return Ok{};
+ }
+ template<typename HeapTypeT>
Result<> makeContNew(Index, const std::vector<Annotation>&, HeapTypeT) {
return Ok{};
}
@@ -2547,6 +2552,13 @@ struct ParseDefsCtx : TypeParserCtx<ParseDefsCtx> {
return withLoc(pos, irBuilder.makeStringSliceIter());
}
+ Result<> makeContBind(Index pos,
+ const std::vector<Annotation>& annotations,
+ HeapType contTypeBefore,
+ HeapType contTypeAfter) {
+ return withLoc(pos, irBuilder.makeContBind(contTypeBefore, contTypeAfter));
+ }
+
Result<> makeContNew(Index pos,
const std::vector<Annotation>& annotations,
HeapType type) {
diff --git a/src/parser/parsers.h b/src/parser/parsers.h
index 4a2b99d84..0dde4b765 100644
--- a/src/parser/parsers.h
+++ b/src/parser/parsers.h
@@ -304,6 +304,8 @@ Result<> makeStringSliceWTF(Ctx&,
template<typename Ctx>
Result<> makeStringSliceIter(Ctx&, Index, const std::vector<Annotation>&);
template<typename Ctx>
+Result<> makeContBind(Ctx&, Index, const std::vector<Annotation>&);
+template<typename Ctx>
Result<> makeContNew(Ctx*, Index, const std::vector<Annotation>&);
template<typename Ctx>
Result<> makeResume(Ctx&, Index, const std::vector<Annotation>&);
@@ -2459,6 +2461,19 @@ Result<> makeStringSliceIter(Ctx& ctx,
return ctx.makeStringSliceIter(pos, annotations);
}
+// contbind ::= 'cont.bind' typeidx typeidx
+template<typename Ctx>
+Result<>
+makeContBind(Ctx& ctx, Index pos, const std::vector<Annotation>& annotations) {
+ auto typeBefore = typeidx(ctx);
+ CHECK_ERR(typeBefore);
+
+ auto typeAfter = typeidx(ctx);
+ CHECK_ERR(typeAfter);
+
+ return ctx.makeContBind(pos, annotations, *typeBefore, *typeAfter);
+}
+
template<typename Ctx>
Result<>
makeContNew(Ctx& ctx, Index pos, const std::vector<Annotation>& annotations) {