Fix pipe indents in when

This commit is contained in:
Joshua Warner 2025-01-11 10:35:09 -08:00
parent 1cc97fcfa7
commit 6d324590da
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 65 additions and 3 deletions

View file

@ -0,0 +1,51 @@
@0-23 SpaceAfter(
When(
@5-6 SpaceAfter(
Num(
"0",
),
[
Newline,
],
),
[
WhenBranch {
patterns: [
@10-16 Apply(
@10-11 Tag(
"S",
),
[
@15-16 SpaceBefore(
SpaceAfter(
Tag(
"H",
),
[
Newline,
],
),
[
LineComment(
"",
),
],
),
],
),
@19-20 Tag(
"B",
),
],
value: @22-23 Var {
module_name: "",
ident: "e",
},
guard: None,
},
],
),
[
Newline,
],
)

View file

@ -0,0 +1,4 @@
when 0
is S#
(H
)|B->e

View file

@ -626,6 +626,7 @@ mod test_snapshots {
pass/parenthetical_var.expr,
pass/parse_alias.expr,
pass/parse_as_ann.expr,
pass/pat_parens_newline_before_pipe_when.expr,
pass/pat_space_after_comma.expr,
pass/pattern_as.expr,
pass/pattern_as_list_rest.expr,