Ensure formatted multiline record patterns work

This commit is contained in:
Joshua Warner 2024-12-14 12:11:10 -08:00
parent 4fd18afce7
commit cccb4abc30
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,10 @@
({ p ? {
}
n,
p ? p?
{
}
c }
"")
<- I
S

View file

@ -0,0 +1,80 @@
@0-24 SpaceAfter(
Backpassing(
[
@0-17 Apply(
@0-17 RecordDestructure(
[
@1-7 OptionalField(
"p",
@3-7 Apply(
@3-6 Record(
Collection {
items: [],
final_comments: [
Newline,
],
},
),
[
@6-7 Var {
module_name: "",
ident: "n",
},
],
Space,
),
),
@8-16 OptionalField(
"p",
@10-16 Apply(
@10-11 TrySuffix {
target: Result,
expr: Var {
module_name: "",
ident: "p",
},
},
[
@12-15 Record(
Collection {
items: [],
final_comments: [
Newline,
],
},
),
@15-16 Var {
module_name: "",
ident: "c",
},
],
Space,
),
),
],
),
[
@17-19 StrLiteral(
PlainLine(
"",
),
),
],
),
],
@21-22 Tag(
"I",
),
@23-24 SpaceBefore(
Tag(
"S",
),
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,4 @@
{p?{
}n,p?p?{
}c}""<-I
S

View file

@ -320,6 +320,7 @@ mod test_snapshots {
pass/backpassing_bananza.expr,
pass/backpassing_comment_pattern_fun.expr,
pass/backpassing_in_parens_in_tuple.expr,
pass/backpassing_record_str_crazyness.expr,
pass/bang_newline_double_accessor.expr,
pass/bangs_and_tuple_accessors.expr,
pass/basic_apply.expr,