mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Relax indentation parsing inside parens, lists, and records
This commit is contained in:
parent
1b4f5bbb52
commit
96c5dcb651
7 changed files with 146 additions and 29 deletions
|
@ -0,0 +1,8 @@
|
|||
({ p ? (
|
||||
p
|
||||
)
|
||||
f, p ? (
|
||||
p
|
||||
)
|
||||
p? } A) <- I
|
||||
S
|
|
@ -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,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
{p?(p
|
||||
)f,p?(p
|
||||
)p?}A<-I
|
||||
S
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue