Format PatternMatchStar (#6653)

This commit is contained in:
Harutaka Kawamura 2023-08-24 10:58:05 +09:00 committed by GitHub
parent 4889b84338
commit 205d234856
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 194 additions and 92 deletions

View file

@ -237,7 +237,6 @@ match foo:
]:
pass
match foo:
case 1:
y = 0
@ -263,3 +262,40 @@ match foo:
# comment
):
y = 1
match foo:
case [1, 2, *rest]:
pass
case [1, 2, *_]:
pass
case [*rest, 1, 2]:
pass
case [*_, 1, 2]:
pass
case [
1,
2,
*rest,
]:
pass
case [1, 2, * # comment
rest]:
pass
case [1, 2, * # comment
_]:
pass
case [* # comment
rest, 1, 2]:
pass
case [* # comment
_, 1, 2]:
pass
case [* # end of line
# own line
_, 1, 2]:
pass
case [* # end of line
# own line
_, 1, 2]:
pass