diff --git a/languages.ncl b/languages.ncl index 62d48ee..7295c3a 100644 --- a/languages.ncl +++ b/languages.ncl @@ -4,7 +4,7 @@ extensions = ["nu"], grammar.source.git = { git = "https://github.com/nushell/tree-sitter-nu.git", - rev = "d9d6ad2c836bc3bd5010ab7850bc6da9498ca576", + rev = "74ff80b2cff6d68286747a3de45531965ad2cf38", }, }, }, diff --git a/languages/nu.scm b/languages/nu.scm index 390c569..2ccc352 100644 --- a/languages/nu.scm +++ b/languages/nu.scm @@ -288,15 +288,15 @@ entry: _ @prepend_spaced_softline ) -;; match_arm -(val_list +(record_body entry: _ @append_space . entry: _ @prepend_spaced_softline ) +;; match_arm (val_list - entry: _ + (list_body) . rest: _ @prepend_spaced_softline ) @@ -305,18 +305,7 @@ row: _ @prepend_spaced_softline ) -(val_record - entry: _ @append_space - . - entry: _ @prepend_spaced_softline -) - -(record_body - entry: (record_entry) @append_space - . - entry: (record_entry) @prepend_spaced_softline -) - +;; type notation (collection_type [ type: _ diff --git a/test/expected_ctrl.nu b/test/expected_ctrl.nu index 35609f9..e751181 100644 --- a/test/expected_ctrl.nu +++ b/test/expected_ctrl.nu @@ -24,6 +24,9 @@ match $foo { match $foo { [a b c] => 0 a | b | c => 42 + a + | b + | c => 42 {$bar $baz} => $baz # ..rest pattern [$x ..$y] if $x == 1 => { 'good list' } diff --git a/test/input_ctrl.nu b/test/input_ctrl.nu index b249bac..e6bae1b 100644 --- a/test/input_ctrl.nu +++ b/test/input_ctrl.nu @@ -22,11 +22,13 @@ match $foo { _ => {exit 0} } match $foo { - [ a b c] => 0 + [ a b, c] => 0 a|b|c => 42 + a + |b|c => 42 { $bar $baz} => $baz # ..rest pattern - [ $x ..$y ] if $x == 1 => { 'good list' } + [ $x , ..$y ] if $x == 1 => { 'good list' } [ ..$y] => { $y } } match $foo {null => {return "default"} $val => $val}