summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2014-07-06 00:11:55 -0500
committerNicolas Williams <nico@cryptonector.com>2014-07-06 01:29:43 -0500
commit7d3a44a1e23ead9dd413ae26f7a5e1de993f376a (patch)
tree6aa9f8aab8dfee579b8872b68875f187d7ae6db3 /parser.y
parent7fce34292e33b967ca19003dd1baf90c0bc42b22 (diff)
Add general `?` operator
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parser.y b/parser.y
index bfd09d35..eb63381a 100644
--- a/parser.y
+++ b/parser.y
@@ -255,6 +255,10 @@ Term "as" '$' IDENT '|' Exp {
$$ = $2;
} |
+Exp '?' {
+ $$ = gen_try($1, gen_op_simple(BACKTRACK));
+} |
+
Exp '=' Exp {
$$ = gen_call("_assign", BLOCK(gen_lambda($1), gen_lambda($3)));