Fix parenthesized spaces in tag unions

This commit is contained in:
Joshua Warner 2024-12-13 13:23:16 -08:00
parent 02e07f95e7
commit 3acc6940b4
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 209 additions and 30 deletions

View file

@ -0,0 +1,60 @@
@0-12 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-10,
],
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(
@0-1 Identifier {
ident: "g",
},
@2-10 TagUnion {
ext: None,
tags: [
@3-9 Apply {
name: @3-4 "T",
args: [
@5-6 SpaceAfter(
Apply(
"",
"T",
[],
),
[
LineComment(
"",
),
],
),
],
},
],
},
),
],
},
@11-12 SpaceBefore(
Tag(
"D",
),
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -298,6 +298,7 @@ mod test_snapshots {
pass/annotated_tuple_destructure.expr,
pass/annotation_apply_newlines.expr,
pass/annotation_comment_before_colon.expr,
pass/annotation_tag_parens_comment.expr,
pass/annotation_tuple_comment.expr,
pass/annotation_tuple_newline.expr,
pass/annotation_tuple_parens_newlines.expr,