mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Reproduce missing support for when
after operator
This commit is contained in:
parent
0d2141d8b8
commit
bbf867c1d1
3 changed files with 59 additions and 0 deletions
|
@ -0,0 +1,54 @@
|
|||
BinOps(
|
||||
[
|
||||
(
|
||||
@0-1 Num(
|
||||
"1",
|
||||
),
|
||||
@2-3 Plus,
|
||||
),
|
||||
],
|
||||
@8-53 SpaceBefore(
|
||||
When(
|
||||
@13-16 Tag(
|
||||
"Foo",
|
||||
),
|
||||
[
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@28-31 SpaceBefore(
|
||||
Tag(
|
||||
"Foo",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @35-36 Num(
|
||||
"2",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
WhenBranch {
|
||||
patterns: [
|
||||
@45-48 SpaceBefore(
|
||||
Tag(
|
||||
"Bar",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
value: @52-53 Num(
|
||||
"3",
|
||||
),
|
||||
guard: None,
|
||||
},
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
1 +
|
||||
when Foo is
|
||||
Foo -> 2
|
||||
Bar -> 3
|
|
@ -229,6 +229,7 @@ mod test_parse {
|
|||
pass/parse_as_ann.expr,
|
||||
pass/pattern_with_space_in_parens.expr, // https://github.com/rtfeldman/roc/issues/929
|
||||
pass/plus_if.expr,
|
||||
pass/plus_when.expr,
|
||||
pass/pos_inf_float.expr,
|
||||
pass/positive_float.expr,
|
||||
pass/positive_int.expr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue