Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
uses: actions/checkout@v4
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v2
with:
tree-sitter-ref: v0.25.10
- name: Set up examples
shell: bash
run: |-
Expand Down
10 changes: 10 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,10 @@ function _ctrl_try_rule(parenthesized) {
keyword().catch,
field('catch_branch', $._blosure),
];
const seq_finally_array = [
keyword().finally,
field('finally_branch', $._blosure),
];
const seq_array = [
keyword().try,
field('try_branch', $.block),
Expand All @@ -1594,6 +1598,11 @@ function _ctrl_try_rule(parenthesized) {
_insert_newline($, seq_catch_array, true, false) :
seq(...seq_catch_array),
),
optional(
parenthesized ?
_insert_newline($, seq_finally_array, true, false) :
seq(...seq_finally_array),
),
];
return parenthesized ?
_insert_newline($, seq_array, false, false) :
Expand Down Expand Up @@ -1956,6 +1965,7 @@ function keyword() {
else: 'else',
try: 'try',
catch: 'catch',
finally: 'finally',
match: 'match',

in: 'in',
Expand Down
1 change: 1 addition & 0 deletions queries/nu/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
[
"try"
"catch"
"finally"
"error"
] @keyword.exception

Expand Down
1 change: 1 addition & 0 deletions script/known-failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ examples/nu_scripts/custom-completions/pytest/pytest-completions.nu
examples/nu_scripts/custom-menus/current_session_history_menu.nu
examples/nu_scripts/example-config/init.nu
examples/nu_scripts/make_release/gen-ts-ext.nu
examples/nu_scripts/make_release/notes/notice.nu
examples/nu_scripts/make_release/notes/tools.nu
examples/nu_scripts/modules/duplicates/example.nu
examples/nu_scripts/modules/kubernetes/complete.nu
Expand Down
127 changes: 119 additions & 8 deletions src/grammar.json

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

18 changes: 18 additions & 0 deletions src/node-types.json

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

Loading
Loading