@@ -236,26 +236,29 @@ template<typename Ctx> WithPosition(Ctx& ctx, Index) -> WithPosition<Ctx>;
236236// | 'extern' => extern
237237template <typename Ctx> Result<typename Ctx::HeapTypeT> heaptype (Ctx& ctx) {
238238 if (ctx.in .takeKeyword (" func" sv)) {
239- return ctx.makeFunc ();
239+ return ctx.makeFuncType ();
240240 }
241241 if (ctx.in .takeKeyword (" any" sv)) {
242- return ctx.makeAny ();
242+ return ctx.makeAnyType ();
243243 }
244244 if (ctx.in .takeKeyword (" extern" sv)) {
245- return ctx.makeExtern ();
245+ return ctx.makeExternType ();
246246 }
247247 if (ctx.in .takeKeyword (" eq" sv)) {
248- return ctx.makeEq ();
248+ return ctx.makeEqType ();
249249 }
250250 if (ctx.in .takeKeyword (" i31" sv)) {
251- return ctx.makeI31 ();
251+ return ctx.makeI31Type ();
252252 }
253253 if (ctx.in .takeKeyword (" struct" sv)) {
254254 return ctx.makeStructType ();
255255 }
256256 if (ctx.in .takeKeyword (" array" sv)) {
257257 return ctx.makeArrayType ();
258258 }
259+ if (ctx.in .takeKeyword (" exn" sv)) {
260+ return ctx.makeExnType ();
261+ }
259262 if (ctx.in .takeKeyword (" string" sv)) {
260263 return ctx.makeStringType ();
261264 }
@@ -268,6 +271,18 @@ template<typename Ctx> Result<typename Ctx::HeapTypeT> heaptype(Ctx& ctx) {
268271 if (ctx.in .takeKeyword (" stringview_iter" sv)) {
269272 return ctx.makeStringViewIterType ();
270273 }
274+ if (ctx.in .takeKeyword (" none" sv)) {
275+ return ctx.makeNoneType ();
276+ }
277+ if (ctx.in .takeKeyword (" noextern" sv)) {
278+ return ctx.makeNoextType ();
279+ }
280+ if (ctx.in .takeKeyword (" nofunc" sv)) {
281+ return ctx.makeNofuncType ();
282+ }
283+ if (ctx.in .takeKeyword (" noexn" sv)) {
284+ return ctx.makeNoexnType ();
285+ }
271286 auto type = typeidx (ctx);
272287 CHECK_ERR (type);
273288 return *type;
@@ -283,26 +298,29 @@ template<typename Ctx> Result<typename Ctx::HeapTypeT> heaptype(Ctx& ctx) {
283298// | '(' ref null? t:heaptype ')' => ref null? t
284299template <typename Ctx> MaybeResult<typename Ctx::TypeT> reftype (Ctx& ctx) {
285300 if (ctx.in .takeKeyword (" funcref" sv)) {
286- return ctx.makeRefType (ctx.makeFunc (), Nullable);
301+ return ctx.makeRefType (ctx.makeFuncType (), Nullable);
287302 }
288303 if (ctx.in .takeKeyword (" externref" sv)) {
289- return ctx.makeRefType (ctx.makeExtern (), Nullable);
304+ return ctx.makeRefType (ctx.makeExternType (), Nullable);
290305 }
291306 if (ctx.in .takeKeyword (" anyref" sv)) {
292- return ctx.makeRefType (ctx.makeAny (), Nullable);
307+ return ctx.makeRefType (ctx.makeAnyType (), Nullable);
293308 }
294309 if (ctx.in .takeKeyword (" eqref" sv)) {
295- return ctx.makeRefType (ctx.makeEq (), Nullable);
310+ return ctx.makeRefType (ctx.makeEqType (), Nullable);
296311 }
297312 if (ctx.in .takeKeyword (" i31ref" sv)) {
298- return ctx.makeRefType (ctx.makeI31 (), Nullable);
313+ return ctx.makeRefType (ctx.makeI31Type (), Nullable);
299314 }
300315 if (ctx.in .takeKeyword (" structref" sv)) {
301316 return ctx.makeRefType (ctx.makeStructType (), Nullable);
302317 }
303318 if (ctx.in .takeKeyword (" arrayref" sv)) {
304319 return ctx.makeRefType (ctx.makeArrayType (), Nullable);
305320 }
321+ if (ctx.in .takeKeyword (" exnref" sv)) {
322+ return ctx.makeRefType (ctx.makeExnType (), Nullable);
323+ }
306324 if (ctx.in .takeKeyword (" stringref" sv)) {
307325 return ctx.makeRefType (ctx.makeStringType (), Nullable);
308326 }
@@ -315,6 +333,18 @@ template<typename Ctx> MaybeResult<typename Ctx::TypeT> reftype(Ctx& ctx) {
315333 if (ctx.in .takeKeyword (" stringview_iter" sv)) {
316334 return ctx.makeRefType (ctx.makeStringViewIterType (), Nullable);
317335 }
336+ if (ctx.in .takeKeyword (" nullref" sv)) {
337+ return ctx.makeRefType (ctx.makeNoneType (), Nullable);
338+ }
339+ if (ctx.in .takeKeyword (" nullexternref" sv)) {
340+ return ctx.makeRefType (ctx.makeNoextType (), Nullable);
341+ }
342+ if (ctx.in .takeKeyword (" nullfuncref" sv)) {
343+ return ctx.makeRefType (ctx.makeNofuncType (), Nullable);
344+ }
345+ if (ctx.in .takeKeyword (" nullexnref" sv)) {
346+ return ctx.makeRefType (ctx.makeNoexnType (), Nullable);
347+ }
318348
319349 if (!ctx.in .takeSExprStart (" ref" sv)) {
320350 return {};
0 commit comments