diff --git a/crates/wast/src/ast/mod.rs b/crates/wast/src/ast/mod.rs index 7b9df8000a..d47f58be66 100644 --- a/crates/wast/src/ast/mod.rs +++ b/crates/wast/src/ast/mod.rs @@ -330,6 +330,7 @@ pub mod kw { custom_keyword!(anyref); custom_keyword!(arg); custom_keyword!(array); + custom_keyword!(assert_exception); custom_keyword!(assert_exhaustion); custom_keyword!(assert_invalid); custom_keyword!(assert_malformed); @@ -343,7 +344,6 @@ pub mod kw { custom_keyword!(assert_return_func); custom_keyword!(assert_trap); custom_keyword!(assert_unlinkable); - custom_keyword!(assert_uncaught_exception); custom_keyword!(before); custom_keyword!(binary); custom_keyword!(block); diff --git a/crates/wast/src/ast/wast.rs b/crates/wast/src/ast/wast.rs index 6f13a7fb9b..00c076362d 100644 --- a/crates/wast/src/ast/wast.rs +++ b/crates/wast/src/ast/wast.rs @@ -93,7 +93,7 @@ pub enum WastDirective<'a> { module: ast::Module<'a>, message: &'a str, }, - AssertUncaughtException { + AssertException { span: ast::Span, exec: WastExecute<'a>, }, @@ -112,7 +112,7 @@ impl WastDirective<'_> { | WastDirective::AssertExhaustion { span, .. } | WastDirective::AssertUnlinkable { span, .. } | WastDirective::AssertInvalid { span, .. } - | WastDirective::AssertUncaughtException { span, .. } => *span, + | WastDirective::AssertException { span, .. } => *span, WastDirective::Invoke(i) => i.span, } } @@ -252,9 +252,9 @@ impl<'a> Parse<'a> for WastDirective<'a> { module: parser.parens(|p| p.parse())?, message: parser.parse()?, }) - } else if l.peek::() { - let span = parser.parse::()?.0; - Ok(WastDirective::AssertUncaughtException { + } else if l.peek::() { + let span = parser.parse::()?.0; + Ok(WastDirective::AssertException { span, exec: parser.parens(|p| p.parse())?, })