Skip to content

Commit 4b978ec

Browse files
committed
fix: hotfix of the ..rest field in _match_pattern_list
1 parent 88a12cc commit 4b978ec

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

languages/nu.scm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@
296296
)
297297

298298
(val_list
299+
entry: _
300+
.
299301
rest: _ @prepend_spaced_softline
300302
)
301303

test/expected_ctrl.nu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ match $foo {
2727
{$bar $baz} => $baz
2828
# ..rest pattern
2929
[$x ..$y] if $x == 1 => { 'good list' }
30+
[..$y] => { $y }
3031
}
3132
match $foo { null => { return "default" } $val => $val }
3233
# while

test/input_ctrl.nu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ match $foo {
2727
{ $bar $baz} => $baz
2828
# ..rest pattern
2929
[ $x ..$y ] if $x == 1 => { 'good list' }
30+
[ ..$y] => { $y }
3031
}
3132
match $foo {null => {return "default"} $val => $val}
3233
# while

0 commit comments

Comments
 (0)