From 16ab43493237c8b82ccb411618f1679a9a321148 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Tue, 29 Jun 2021 17:34:51 -0700 Subject: Allow plain `try` with no `catch` or `delegate` (#1676) Matches recent changes in the exception handling spec that allowed this case to reduce special cases in the syntax: https://github.com/WebAssembly/exception-handling/pull/157 --- test/parse/expr/bad-try-clause.txt | 10 ++++++++++ test/parse/expr/bad-try-no-catch.txt | 14 -------------- test/parse/expr/try.txt | 6 ++++++ 3 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 test/parse/expr/bad-try-clause.txt delete mode 100644 test/parse/expr/bad-try-no-catch.txt (limited to 'test/parse') diff --git a/test/parse/expr/bad-try-clause.txt b/test/parse/expr/bad-try-clause.txt new file mode 100644 index 00000000..f8575c8c --- /dev/null +++ b/test/parse/expr/bad-try-clause.txt @@ -0,0 +1,10 @@ +;;; TOOL: wat2wasm +;;; ARGS: --enable-exceptions +;;; ERROR: 1 +(module + (func (try (do) (foo))) +(;; STDERR ;;; +out/test/parse/expr/bad-try-clause.txt:5:20: error: unexpected token "foo", expected catch, catch_all or delegate. + (func (try (do) (foo))) + ^^^ +;;; STDERR ;;) diff --git a/test/parse/expr/bad-try-no-catch.txt b/test/parse/expr/bad-try-no-catch.txt deleted file mode 100644 index c85756fb..00000000 --- a/test/parse/expr/bad-try-no-catch.txt +++ /dev/null @@ -1,14 +0,0 @@ -;;; TOOL: wat2wasm -;;; ARGS: --enable-exceptions -;;; ERROR: 1 -(module - (func try nop end) - (func (try (do nop)))) -(;; STDERR ;;; -out/test/parse/expr/bad-try-no-catch.txt:5:17: error: unexpected token "end", expected catch, catch_all or delegate. - (func try nop end) - ^^^ -out/test/parse/expr/bad-try-no-catch.txt:6:22: error: unexpected token ), expected (. - (func (try (do nop)))) - ^ -;;; STDERR ;;) diff --git a/test/parse/expr/try.txt b/test/parse/expr/try.txt index c10eebc2..51ed83b5 100644 --- a/test/parse/expr/try.txt +++ b/test/parse/expr/try.txt @@ -3,6 +3,12 @@ (module (tag (param i32)) + ;; no catch + (func + try + nop + end) + ;; bare (func try -- cgit v1.2.3