Skip to content

Commit

Permalink
Fix a bit of mixing old and new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jan 8, 2024
1 parent 95b31e0 commit 78670dd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/wast/src/core/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1104,10 +1104,11 @@ impl<'a> Parse<'a> for TryTable<'a> {
let block = parser.parse()?;

let mut catches = Vec::new();
while parser.peek2::<kw::catch>()?
|| parser.peek2::<kw::catch_ref>()?
|| parser.peek2::<kw::catch_all>()?
|| parser.peek2::<kw::catch_all_ref>()?
while parser.peek::<LParen>()?
&& (parser.peek2::<kw::catch>()?
|| parser.peek2::<kw::catch_ref>()?
|| parser.peek2::<kw::catch_all>()?
|| parser.peek2::<kw::catch_all_ref>()?)
{
catches.push(parser.parens(|p| {
let kind = if parser.peek::<kw::catch_ref>()? {
Expand Down
7 changes: 7 additions & 0 deletions tests/cli/print-deprecated-exceptions.wat
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@
drop
drop
)
(func $mix-old-and-new
try_table
try
catch_all
end
end
)
)
7 changes: 7 additions & 0 deletions tests/cli/print-deprecated-exceptions.wat.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,12 @@
drop
drop
)
(func $mix-old-and-new (;3;) (type 2)
try_table ;; label = @1
try ;; label = @2
catch_all
end
end
)
(tag (;1;) (type 1) (param i32))
)

0 comments on commit 78670dd

Please sign in to comment.