mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Ensure formatted multiline record patterns work
This commit is contained in:
parent
4fd18afce7
commit
cccb4abc30
5 changed files with 101 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
|||
({ p ? {
|
||||
}
|
||||
n,
|
||||
p ? p?
|
||||
{
|
||||
}
|
||||
c }
|
||||
"")
|
||||
<- I
|
||||
S
|
|
@ -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,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
{p?{
|
||||
}n,p?p?{
|
||||
}c}""<-I
|
||||
S
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue