Fix formatting of negative numbers in pnc apply patterns

This commit is contained in:
Joshua Warner 2025-01-10 22:03:06 -08:00
parent 2e4e4bb957
commit 586dc3486f
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
7 changed files with 70 additions and 3 deletions

View file

@ -0,0 +1,46 @@
@0-10 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-8,
],
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-6 PncApply(
@1-3 NumLiteral(
"-8",
),
[],
),
@7-8 Apply(
"",
"C",
[],
),
),
],
},
@9-10 SpaceBefore(
Num(
"8",
),
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,2 @@
(-8)():C
8

View file

@ -639,6 +639,7 @@ mod test_snapshots {
pass/plus_if.expr,
pass/plus_when.expr,
pass/pnc_apply_comment_after_newline.expr,
pass/pnc_apply_neg_pattern.expr,
pass/pnc_parens_apply_etc.expr,
pass/pos_inf_float.expr,
pass/positive_float.expr,