Fix multi-backpassing in top-level defs

Fixes #4821
This commit is contained in:
Joshua Warner 2023-01-15 10:38:14 -08:00
parent 545e6bc989
commit 3b51d7cd13
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 77 additions and 3 deletions

View file

@ -0,0 +1,3 @@
main =
arg1, arg2 <- f {}
"Roc <3 Zig!\n"

View file

@ -0,0 +1,67 @@
Defs {
tags: [
Index(2147483648),
],
regions: [
@0-50,
],
space_before: [
Slice(start = 0, length = 0),
],
space_after: [
Slice(start = 0, length = 0),
],
spaces: [],
type_defs: [],
value_defs: [
Body(
@0-4 Identifier(
"main",
),
@12-50 SpaceBefore(
Backpassing(
[
@12-16 Identifier(
"arg1",
),
@18-22 Identifier(
"arg2",
),
],
@26-30 Apply(
@26-27 Var {
module_name: "",
ident: "f",
},
[
@28-30 Record(
[],
),
],
Space,
),
@35-50 SpaceBefore(
Str(
Line(
[
Plaintext(
"Roc <3 Zig!",
),
EscapedChar(
Newline,
),
],
),
),
[
Newline,
],
),
),
[
Newline,
],
),
),
],
}

View file

@ -0,0 +1,3 @@
main =
arg1, arg2 <- f {}
"Roc <3 Zig!\n"

View file

@ -309,6 +309,7 @@ mod test_snapshots {
pass/mixed_docs.expr,
pass/module_def_newline.moduledefs,
pass/multi_backpassing.expr,
pass/multi_backpassing_in_def.moduledefs,
pass/multi_backpassing_with_apply.expr,
pass/multi_char_string.expr,
pass/multiline_string.expr,