Don't turn pnc apply dbg into DbgStmt

This commit is contained in:
Joshua Warner 2025-01-11 10:37:28 -08:00
parent 6d324590da
commit 6d2b635dbc
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
7 changed files with 103 additions and 82 deletions

View file

@ -1,22 +1,46 @@
@0-8 SpaceAfter(
DbgStmt {
first: @4-7 BinOps(
[
(
@4-5 Var {
module_name: "",
ident: "a",
},
@5-6 Slash,
@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: [
Stmt(
@0-8 PncApply(
@0-3 Dbg,
[
@4-7 BinOps(
[
(
@4-5 Var {
module_name: "",
ident: "a",
},
@5-6 Slash,
),
],
@6-7 Var {
module_name: "",
ident: "a",
},
),
],
),
),
],
@6-7 Var {
module_name: "",
ident: "a",
},
),
extra_args: [],
continuation: @9-10 SpaceBefore(
},
@9-10 SpaceBefore(
Var {
module_name: "",
ident: "d",
@ -25,8 +49,7 @@
Newline,
],
),
pnc_style: true,
},
),
[
Newline,
],

View file

@ -0,0 +1,53 @@
@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: [
Stmt(
@0-10 ParensAround(
PncApply(
@1-4 Dbg,
[
@5-6 SpaceAfter(
Num(
"5",
),
[
LineComment(
"",
),
],
),
],
),
),
),
],
},
@11-12 SpaceBefore(
Var {
module_name: "",
ident: "e",
},
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,3 @@
(dbg(5#
))
e

View file

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