Format PatternMatchClass (#6860)

This commit is contained in:
Victor Hugo Gomes 2023-08-25 16:03:37 -03:00 committed by GitHub
parent 91880b8273
commit 91a780c771
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 458 additions and 536 deletions

View file

@ -264,6 +264,7 @@ match foo:
y = 1
match foo:
case [1, 2, *rest]:
pass
@ -399,3 +400,61 @@ match foo:
b,
}:
pass
match pattern_match_class:
case Point2D(
# own line
):
...
case (
Point2D
# own line
()
):
...
case Point2D( # end of line line
):
...
case Point2D( # end of line
0, 0
):
...
case Point2D(0, 0):
...
case Point2D(
( # end of line
# own line
0
), 0):
...
case Point3D(x=0, y=0, z=000000000000000000000000000000000000000000000000000000000000000000000000000000000):
...
case Bar(0, a=None, b="hello"):
...
case FooBar(# leading
# leading
# leading
# leading
0 # trailing
# trailing
# trailing
# trailing
):
...
case A(
b # b
= # c
2 # d
# e
):
pass