Move unit assignment handling to lifting phase

This commit is contained in:
Joshua Warner 2025-01-13 19:46:55 -08:00
parent ff230c4261
commit 6127bd2d26
5 changed files with 127 additions and 48 deletions

View file

@ -0,0 +1,58 @@
@0-18 SpaceAfter(
Return(
@0-18 SpaceBefore(
Defs(
Defs {
tags: [
EitherIndex(2147483648),
],
regions: [
@8-15,
],
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(
@8-10 RecordDestructure(
[],
),
@14-15 SpaceBefore(
Var {
module_name: "",
ident: "s",
},
[
LineComment(
"",
),
],
),
),
],
},
@17-18 SpaceBefore(
Var {
module_name: "",
ident: "r",
},
[
Newline,
],
),
),
[
Newline,
],
),
None,
),
[
Newline,
],
)

View file

@ -0,0 +1,4 @@
return
{}=#
s
r

View file

@ -681,6 +681,7 @@ mod test_snapshots {
pass/repr_7342.expr,
pass/requires_type.header,
pass/return_apply_newline.expr,
pass/return_empty_assign.expr,
pass/return_field_access_in_parens.expr,
pass/return_in_apply_func.expr,
pass/return_in_if.expr,