Implement ? binop operator

This commit is contained in:
Sam Mohr 2025-01-16 02:44:32 -08:00
parent 9d37c906fe
commit b73e4387ae
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
12 changed files with 291 additions and 55 deletions

View file

@ -0,0 +1,3 @@
fallible!(args)
? \my_err ->
my_err * 2

View file

@ -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,
],
)

View file

@ -0,0 +1,2 @@
fallible!(args) ? |my_err|
my_err * 2

View file

@ -0,0 +1 @@
fallible!(args) ? WrapOverErr

View file

@ -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,
],
)

View file

@ -0,0 +1 @@
fallible!(args) ? WrapOverErr