mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Implement ? binop operator
This commit is contained in:
parent
9d37c906fe
commit
b73e4387ae
12 changed files with 291 additions and 55 deletions
|
@ -0,0 +1,3 @@
|
|||
fallible!(args)
|
||||
? \my_err ->
|
||||
my_err * 2
|
|
@ -0,0 +1,50 @@
|
|||
@0-43 SpaceAfter(
|
||||
BinOps(
|
||||
[
|
||||
(
|
||||
@0-15 PncApply(
|
||||
@0-9 Var {
|
||||
module_name: "",
|
||||
ident: "fallible!",
|
||||
},
|
||||
[
|
||||
@10-14 Var {
|
||||
module_name: "",
|
||||
ident: "args",
|
||||
},
|
||||
],
|
||||
),
|
||||
@18-19 SingleQuestion,
|
||||
),
|
||||
],
|
||||
@20-43 Closure(
|
||||
[
|
||||
@21-27 Identifier {
|
||||
ident: "my_err",
|
||||
},
|
||||
],
|
||||
@33-43 SpaceBefore(
|
||||
BinOps(
|
||||
[
|
||||
(
|
||||
@33-39 Var {
|
||||
module_name: "",
|
||||
ident: "my_err",
|
||||
},
|
||||
@40-41 Star,
|
||||
),
|
||||
],
|
||||
@42-43 Num(
|
||||
"2",
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
fallible!(args) ? |my_err|
|
||||
my_err * 2
|
|
@ -0,0 +1 @@
|
|||
fallible!(args) ? WrapOverErr
|
|
@ -0,0 +1,27 @@
|
|||
@0-31 SpaceAfter(
|
||||
BinOps(
|
||||
[
|
||||
(
|
||||
@0-15 PncApply(
|
||||
@0-9 Var {
|
||||
module_name: "",
|
||||
ident: "fallible!",
|
||||
},
|
||||
[
|
||||
@10-14 Var {
|
||||
module_name: "",
|
||||
ident: "args",
|
||||
},
|
||||
],
|
||||
),
|
||||
@18-19 SingleQuestion,
|
||||
),
|
||||
],
|
||||
@20-31 Tag(
|
||||
"WrapOverErr",
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
fallible!(args) ? WrapOverErr
|
Loading…
Add table
Add a link
Reference in a new issue