Skip to content

Commit

Permalink
Add support for finally.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed May 1, 2024
1 parent ea97fa1 commit 66f6cb6
Show file tree
Hide file tree
Showing 4 changed files with 91,289 additions and 73,156 deletions.
9 changes: 9 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,13 @@ module.exports = grammar({
prec.left("coalesce", seq($._expr, alias("??", $.op), $._expr)),
try: $ =>
choice(
seq(
"try",
alias($._exprs, $.try_body),
"finally",
alias($._exprs, $.try_finqlly),
"end"
),
seq(
"try",
alias($._exprs, $.try_body),
Expand All @@ -746,6 +753,7 @@ module.exports = grammar({
field("in", $.list),
"do",
alias($._exprs, $.try_do),
optional(seq("finally", alias($._exprs, $.try_finally))),
alias("end", "try_end"),
),
seq(
Expand All @@ -755,6 +763,7 @@ module.exports = grammar({
field("catch", $._optvar),
"do",
alias($._exprs, $.try_do),
optional(seq("finally", alias($._exprs, $.try_finally))),
alias("end", "for_end"),
),
),
Expand Down
87 changes: 87 additions & 0 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 66f6cb6

Please sign in to comment.