Fix newlines after multiline apply func pattern (#7342)

This commit is contained in:
Joshua Warner 2024-12-11 21:33:44 -08:00
parent 8701b922b4
commit f5cd0568dd
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
16 changed files with 143 additions and 24 deletions

View file

@ -1,4 +1,5 @@
1 (0 #
1
(0 #
f)
(0 #
f) : f

View file

@ -0,0 +1,6 @@
(
1 #
Q
a : t
n
)

View file

@ -0,0 +1,61 @@
@0-14 SpaceAfter(
ParensAround(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@1-11,
],
space_before: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
],
space_after: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
],
spaces: [],
type_defs: [],
value_defs: [
Annotation(
@2-3 Apply(
@2-3 SpaceAfter(
NumLiteral(
"1",
),
[
LineComment(
"",
),
],
),
[
@6-7 Tag(
"Q",
),
@8-9 Identifier {
ident: "a",
},
],
),
@10-11 BoundVariable(
"t",
),
),
],
},
@12-13 SpaceBefore(
Var {
module_name: "",
ident: "n",
},
[
Newline,
],
),
),
),
[
Newline,
],
)

View file

@ -0,0 +1,3 @@
((1#
)Q a:t
n)

View file

@ -0,0 +1,6 @@
(
i <- (
dbg 0
_)
9
)

View file

@ -0,0 +1,40 @@
@0-18 SpaceAfter(
ParensAround(
ParensAround(
Backpassing(
[
@2-3 Identifier {
ident: "i",
},
],
@5-14 ParensAround(
DbgStmt {
first: @10-11 Num(
"0",
),
extra_args: [],
continuation: @12-13 SpaceBefore(
Underscore(
"",
),
[
Newline,
],
),
},
),
@15-16 SpaceBefore(
Num(
"9",
),
[
Newline,
],
),
),
),
),
[
Newline,
],
)

View file

@ -0,0 +1,3 @@
((i<-(dbg 0
_)
9))

View file

@ -596,6 +596,8 @@ mod test_snapshots {
pass/record_updater_var_apply.expr,
pass/record_with_if.expr,
pass/record_with_lots_of_newlines.expr,
pass/repr_7342.expr,
pass/repr_7343.expr,
pass/repr_7346.expr,
pass/requires_type.header,
pass/return_apply_newline.expr,