File tree Expand file tree Collapse file tree 4 files changed +12
-18
lines changed
Expand file tree Collapse file tree 4 files changed +12
-18
lines changed Original file line number Diff line number Diff line change 44 extensions = ["nu" ],
55 grammar . source . git = {
66 git = "https://github.com/nushell/tree-sitter-nu.git" ,
7- rev = "d9d6ad2c836bc3bd5010ab7850bc6da9498ca576 " ,
7+ rev = "74ff80b2cff6d68286747a3de45531965ad2cf38 " ,
88 },
99 },
1010 },
Original file line number Diff line number Diff line change 288288 entry: _ @prepend_spaced_softline
289289)
290290
291- ;; match_arm
292- (val_list
291+ (record_body
293292 entry: _ @append_space
294293 .
295294 entry: _ @prepend_spaced_softline
296295)
297296
297+ ;; match_arm
298298(val_list
299- entry: _
299+ (list_body)
300300 .
301301 rest: _ @prepend_spaced_softline
302302)
305305 row: _ @prepend_spaced_softline
306306)
307307
308- (val_record
309- entry: _ @append_space
310- .
311- entry: _ @prepend_spaced_softline
312- )
313-
314- (record_body
315- entry: (record_entry) @append_space
316- .
317- entry: (record_entry) @prepend_spaced_softline
318- )
319-
308+ ;; type notation
320309(collection_type
321310 [
322311 type: _
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ match $foo {
2424match $foo {
2525 [a b c ] => 0
2626 a | b | c => 42
27+ a
28+ | b
29+ | c => 42
2730 {$bar $baz } => $baz
2831 # ..rest pattern
2932 [$x .. $y ] if $x == 1 => { ' good list' }
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ match $foo {
2222 _ => {exit 0 }
2323}
2424match $foo {
25- [ a b c ] => 0
25+ [ a b , c ] => 0
2626 a | b | c => 42
27+ a
28+ | b | c => 42
2729 { $bar $baz } => $baz
2830 # ..rest pattern
29- [ $x .. $y ] if $x == 1 => { ' good list' }
31+ [ $x , .. $y ] if $x == 1 => { ' good list' }
3032 [ .. $y ] => { $y }
3133}
3234match $foo {null => {return " default" } $val => $val }
You can’t perform that action at this time.
0 commit comments