mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-01 21:40:58 +00:00
Fix when in when guard
This commit is contained in:
parent
586dc3486f
commit
903b792fd3
6 changed files with 117 additions and 5 deletions
|
|
@ -4,6 +4,5 @@ di
|
|||
when
|
||||
b
|
||||
is
|
||||
7 -> 7e
|
||||
)
|
||||
7 -> 7e)
|
||||
zl
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
when
|
||||
f
|
||||
is
|
||||
s if (
|
||||
when
|
||||
0
|
||||
is
|
||||
z ->
|
||||
f
|
||||
z) -> m
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
@0-35 SpaceAfter(
|
||||
When(
|
||||
@5-6 SpaceAfter(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "f",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@10-11 SpaceBefore(
|
||||
Identifier {
|
||||
ident: "s",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @34-35 Var {
|
||||
module_name: "",
|
||||
ident: "m",
|
||||
},
|
||||
guard: Some(
|
||||
@15-32 When(
|
||||
@20-21 SpaceAfter(
|
||||
Num(
|
||||
"0",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@25-26 Identifier {
|
||||
ident: "z",
|
||||
},
|
||||
],
|
||||
value: @28-32 Apply(
|
||||
@28-29 Var {
|
||||
module_name: "",
|
||||
ident: "f",
|
||||
},
|
||||
[
|
||||
@31-32 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "z",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
],
|
||||
),
|
||||
),
|
||||
},
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
when f
|
||||
is
|
||||
s if when 0
|
||||
is z->f
|
||||
z->m
|
||||
|
|
@ -764,6 +764,7 @@ mod test_snapshots {
|
|||
pass/when_in_list.expr,
|
||||
pass/when_in_parens.expr,
|
||||
pass/when_in_parens_indented.expr,
|
||||
pass/when_in_when_guard_wtf.expr,
|
||||
pass/when_newline_after_condition.expr,
|
||||
pass/when_newline_before_is_and_in_branch_parens.expr,
|
||||
pass/when_result_list.expr,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue