Relax indentation parsing inside parens, lists, and records

This commit is contained in:
Joshua Warner 2024-12-15 08:36:24 -08:00
parent 1b4f5bbb52
commit 96c5dcb651
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
7 changed files with 146 additions and 29 deletions

View file

@ -0,0 +1,8 @@
({ p ? (
p
)
f, p ? (
p
)
p? } A) <- I
S

View file

@ -0,0 +1,80 @@
@0-24 SpaceAfter(
Backpassing(
[
@0-18 Apply(
@0-18 RecordDestructure(
[
@1-8 OptionalField(
"p",
@3-8 Apply(
@4-5 ParensAround(
SpaceAfter(
Var {
module_name: "",
ident: "p",
},
[
Newline,
],
),
),
[
@7-8 Var {
module_name: "",
ident: "f",
},
],
Space,
),
),
@9-17 OptionalField(
"p",
@11-17 Apply(
@12-13 ParensAround(
SpaceAfter(
Var {
module_name: "",
ident: "p",
},
[
Newline,
],
),
),
[
@15-16 TrySuffix {
target: Result,
expr: Var {
module_name: "",
ident: "p",
},
},
],
Space,
),
),
],
),
[
@18-19 Tag(
"A",
),
],
),
],
@21-22 Tag(
"I",
),
@23-24 SpaceBefore(
Tag(
"S",
),
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,4 @@
{p?(p
)f,p?(p
)p?}A<-I
S

View file

@ -324,6 +324,7 @@ mod test_snapshots {
pass/backpassing_comment_pattern_fun.expr,
pass/backpassing_in_parens_in_tuple.expr,
pass/backpassing_parens_comment.expr,
pass/backpassing_pattern_weirdness.expr,
pass/backpassing_record_str_crazyness.expr,
pass/bang_newline_double_accessor.expr,
pass/bangs_and_tuple_accessors.expr,