Generalize fmt rules around multiline strs in pats

This commit is contained in:
Joshua Warner 2024-12-14 10:50:28 -08:00
parent d52595738f
commit 8b7ac512f8
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 83 additions and 18 deletions

View file

@ -0,0 +1,58 @@
@0-15 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-13,
],
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(
@1-2 Apply(
@1-2 SpaceAfter(
NumLiteral(
"4",
),
[
Newline,
Newline,
],
),
[
@5-11 StrLiteral(
Block(
[],
),
),
],
),
@12-13 Apply(
"",
"C",
[],
),
),
],
},
@14-15 SpaceBefore(
Tag(
"U",
),
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -480,6 +480,7 @@ mod test_snapshots {
pass/multiline_apply_equals_multiline_apply.expr,
pass/multiline_backpassing.expr,
pass/multiline_binop_when_with_comments.expr,
pass/multiline_str_after_newlines_in_pat.expr,
pass/multiline_str_apply_in_parens_pat.expr,
pass/multiline_str_crazyness.expr,
pass/multiline_str_in_backpassing_pats.expr,