Make nodes more strongly normalizing to fix confusion with outdentability

This commit is contained in:
Joshua Warner 2025-01-12 13:21:04 -08:00
parent a945fd9c5c
commit ff230c4261
6 changed files with 107 additions and 21 deletions

View file

@ -0,0 +1,3 @@
2 : (
)e where p implements T
e

View file

@ -0,0 +1,71 @@
@0-29 SpaceAfter(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@0-27,
],
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 NumLiteral(
"2",
),
@2-27 Where(
@2-6 Tuple {
elems: Collection {
items: [],
final_comments: [
Newline,
],
},
ext: Some(
@5-6 BoundVariable(
"e",
),
),
},
[
@13-27 ImplementsClause {
var: @13-14 SpaceBefore(
"p",
[
Newline,
],
),
abilities: [
@26-27 Apply(
"",
"T",
[],
),
],
},
],
),
),
],
},
@28-29 SpaceBefore(
Var {
module_name: "",
ident: "e",
},
[
Newline,
],
),
),
[
Newline,
],
)

View file

@ -0,0 +1,4 @@
2:(
)e where
p implements T
e

View file

@ -802,6 +802,7 @@ mod test_snapshots {
pass/where_implements_lots_of_newlines.expr,
pass/where_in_tuple_after_comment.expr,
pass/where_in_tuple_plain.expr,
pass/where_newline_p_implements.expr,
pass/zero_float.expr,
pass/zero_int.expr,
// END SNAPSHOTS (for automatic test detection via `env ROC_SNAPSHOT_TEST_OVERWRITE=1 cargo test`)