Improve normalization to handle cases found in fuzzing

This commit is contained in:
Joshua Warner 2024-12-01 09:29:06 -08:00
parent 912db1b76b
commit 61d885039d
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 93 additions and 27 deletions

View file

@ -0,0 +1,53 @@
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-11,
],
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: [
Body(
@0-3 RecordDestructure(
Collection {
items: [],
final_comments: [
Newline,
],
},
),
@4-11 Apply(
@4-7 Dbg,
[
@8-9 Var {
module_name: "",
ident: "d",
},
@10-11 Var {
module_name: "",
ident: "z",
},
],
Space,
),
),
],
},
@12-14 SpaceBefore(
Var {
module_name: "",
ident: "dd",
},
[
Newline,
],
),
)

View file

@ -0,0 +1,3 @@
{
}=dbg d z
dd

View file

@ -324,6 +324,7 @@ mod test_snapshots {
pass/dbg.expr,
pass/dbg_double.expr,
pass/dbg_double_newline.expr,
pass/dbg_extra_parens.expr,
pass/dbg_newline_apply.expr,
pass/dbg_stmt.expr,
pass/dbg_stmt_multiline.expr,