Skip to content

Commit

Permalink
parser: allow expressions for throw
Browse files Browse the repository at this point in the history
Fixes #97
  • Loading branch information
jkbz64 committed Nov 18, 2024
1 parent b1dad3e commit 08943fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ module.exports = grammar({
seq(kw("NEXT"), field("label", optional($.identifier))),
seq(kw("RETRY"), field("label", optional($.identifier))),
seq(kw("RETURN"), choice(seq(kw("ERROR")), kw("NO-APPLY"))),
seq(kw("THROW"), $.new_expression)
seq(kw("THROW"), $._expression)
),
$._terminator
),
Expand Down
3 changes: 3 additions & 0 deletions test/corpus/basic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,7 @@ CATCH and FINALLY statements
DO TRANSACTION:
CATCH e AS CLASS Progress.Lang.SysError:
MESSAGE "sys error" VIEW-AS ALERT-BOX.
UNDO, THROW e.
END.
CATCH e AS Progress.Lang.Error:
MESSAGE "other error" VIEW-AS ALERT-BOX.
Expand All @@ -1668,6 +1669,8 @@ END.
statement: (identifier)
(string_literal)
(identifier)
(identifier))
(undo_statement
(identifier))))
(catch_statement
variable: (identifier)
Expand Down

0 comments on commit 08943fe

Please sign in to comment.