mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Properly implement lifting for if and when
This commit is contained in:
parent
2918e26b38
commit
14b18f4213
5 changed files with 93 additions and 2 deletions
|
@ -0,0 +1,2 @@
|
|||
when n is
|
||||
O -> s #
|
|
@ -0,0 +1,39 @@
|
|||
@0-17 SpaceAfter(
|
||||
When(
|
||||
@5-6 Var {
|
||||
module_name: "",
|
||||
ident: "n",
|
||||
},
|
||||
[
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@10-11 SpaceBefore(
|
||||
Tag(
|
||||
"O",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @13-17 ParensAround(
|
||||
SpaceAfter(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "s",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
],
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
when n is
|
||||
O->(s
|
||||
)#
|
|
@ -751,6 +751,7 @@ mod test_snapshots {
|
|||
pass/var_minus_two.expr,
|
||||
pass/var_then.expr,
|
||||
pass/var_when.expr,
|
||||
pass/when_branch_comment_after_parens.expr,
|
||||
pass/when_comment_after_pattern.expr,
|
||||
pass/when_comment_bbefore_if.expr,
|
||||
pass/when_if_guard.expr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue