Fix empty SpaceBefore instance

This commit is contained in:
Joshua Warner 2024-12-12 21:38:52 -08:00
parent f1d9667ea0
commit d3426ebce1
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
7 changed files with 92 additions and 93 deletions

View file

@ -0,0 +1 @@
Expr(BadOperator("=", @13), @0)

View file

@ -0,0 +1,3 @@
(
return e
t)=t

View file

@ -1,22 +1,19 @@
@0-10 SpaceBefore(
Return(
@0-8 UnaryOp(
@7-8 Var {
module_name: "",
ident: "r",
},
@6-7 Negate,
),
Some(
@9-10 SpaceBefore(
Num(
"1",
),
[
Newline,
],
@0-10 Return(
@0-8 UnaryOp(
@7-8 Var {
module_name: "",
ident: "r",
},
@6-7 Negate,
),
Some(
@9-10 SpaceBefore(
Num(
"1",
),
[
Newline,
],
),
),
[],
)

View file

@ -1,38 +1,35 @@
@0-17 SpaceAfter(
SpaceBefore(
Return(
@0-8 Var {
module_name: "",
ident: "n",
},
Some(
@9-17 SpaceBefore(
ParensAround(
SpaceAfter(
ParensAround(
SpaceAfter(
Num(
"0",
),
[
Newline,
],
Return(
@0-8 Var {
module_name: "",
ident: "n",
},
Some(
@9-17 SpaceBefore(
ParensAround(
SpaceAfter(
ParensAround(
SpaceAfter(
Num(
"0",
),
[
Newline,
],
),
[
LineComment(
"",
),
],
),
[
LineComment(
"",
),
],
),
[
Newline,
],
),
[
Newline,
],
),
),
[],
),
[
Newline,

View file

@ -1,48 +1,45 @@
@0-13 SpaceBefore(
Return(
@0-8 Num(
"-1",
),
Some(
@10-13 Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@10-11,
],
space_before: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 1 },
],
space_after: [
Slice<roc_parse::ast::CommentOrNewline> { start: 1, length: 0 },
],
spaces: [
LineComment(
"",
@0-13 Return(
@0-8 Num(
"-1",
),
Some(
@10-13 Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@10-11,
],
space_before: [
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 1 },
],
space_after: [
Slice<roc_parse::ast::CommentOrNewline> { start: 1, length: 0 },
],
spaces: [
LineComment(
"",
),
],
type_defs: [],
value_defs: [
Stmt(
@10-11 Tag(
"X",
),
],
type_defs: [],
value_defs: [
Stmt(
@10-11 Tag(
"X",
),
),
],
),
],
},
@12-13 SpaceBefore(
Var {
module_name: "",
ident: "s",
},
@12-13 SpaceBefore(
Var {
module_name: "",
ident: "s",
},
[
Newline,
],
),
[
Newline,
],
),
),
),
[],
)

View file

@ -240,6 +240,7 @@ mod test_snapshots {
fail/record_type_open_indent.expr,
fail/record_type_tab.expr,
fail/return_as_single_line_expr.expr,
fail/return_in_pat.expr,
fail/single_no_end.expr,
fail/tab_crash.header,
fail/tag_union_end.expr,