Skip to content

Commit 88a12cc

Browse files
committed
fix: ..rest prepend_spaced_softline in aliased val_list for _match_pattern_list
1 parent 10e9040 commit 88a12cc

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

languages/nu.scm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@
295295
entry: _ @prepend_spaced_softline
296296
)
297297

298+
(val_list
299+
rest: _ @prepend_spaced_softline
300+
)
301+
298302
(val_table
299303
row: _ @prepend_spaced_softline
300304
)

test/expected_ctrl.nu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ match $foo {
2525
[a b c] => 0
2626
a | b | c => 42
2727
{$bar $baz} => $baz
28+
# ..rest pattern
29+
[$x ..$y] if $x == 1 => { 'good list' }
2830
}
2931
match $foo { null => { return "default" } $val => $val }
3032
# while

test/input_ctrl.nu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ match $foo {
2525
[ a b c] => 0
2626
a|b|c => 42
2727
{ $bar $baz} => $baz
28+
# ..rest pattern
29+
[ $x ..$y ] if $x == 1 => { 'good list' }
2830
}
2931
match $foo {null => {return "default"} $val => $val}
3032
# while

0 commit comments

Comments
 (0)