Preserve info about whether a given dbg stmt was pnc or not, at least for now

This commit is contained in:
Joshua Warner 2025-01-09 22:17:25 -08:00
parent 1bb9f7f530
commit 13a70c060d
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
18 changed files with 95 additions and 10 deletions

View file

@ -25,6 +25,7 @@
Newline,
],
),
pnc_style: true,
},
[
Newline,

View file

@ -0,0 +1,49 @@
@0-12 SpaceAfter(
ParensAround(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@1-9,
],
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(
@1-9 ParensAround(
PncApply(
@2-5 Dbg,
[
@6-7 Var {
module_name: "",
ident: "r",
},
],
),
),
),
],
},
@10-11 SpaceBefore(
Var {
module_name: "",
ident: "r",
},
[
Newline,
],
),
),
),
[
Newline,
],
)

View file

@ -0,0 +1,2 @@
((dbg(r))
r)

View file

@ -26,6 +26,7 @@
Newline,
],
),
pnc_style: false,
},
[
Newline,

View file

@ -23,5 +23,6 @@
Newline,
],
),
pnc_style: false,
},
)

View file

@ -25,6 +25,7 @@
Newline,
],
),
pnc_style: false,
},
[
Newline,

View file

@ -49,6 +49,7 @@
Newline,
],
),
pnc_style: false,
},
[
Newline,

View file

@ -22,6 +22,7 @@
Newline,
],
),
pnc_style: false,
},
[
LineComment(

View file

@ -36,6 +36,7 @@
Newline,
],
),
pnc_style: false,
},
[
Newline,

View file

@ -398,6 +398,7 @@ mod test_snapshots {
pass/dbg_extra_parens.expr,
pass/dbg_newline_apply.expr,
pass/dbg_pnc_a_over_a.expr,
pass/dbg_pnc_in_double_parens.expr,
pass/dbg_pnc_zero_args.expr,
pass/dbg_stmt.expr,
pass/dbg_stmt_in_parens.expr,