Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add nqp::resume(...) for resuming an exception.

  • Loading branch information...
commit cfdcc70787ded5ec4f3b56926fd3f5cbec58f5f2 1 parent 47effd6
@jnthn jnthn authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/QAST/Operations.nqp
View
12 src/QAST/Operations.nqp
@@ -1334,6 +1334,18 @@ QAST::Operations.add_core_pirop_mapping('die_s', 'die', '0s');
QAST::Operations.add_core_pirop_mapping('die', 'die', '0P');
QAST::Operations.add_core_pirop_mapping('throw', 'throw', '0P');
QAST::Operations.add_core_pirop_mapping('rethrow', 'rethrow', '0P');
+QAST::Operations.add_core_op('resume', -> $qastcomp, $op {
+ if +$op.list != 1 {
+ nqp::die("The 'resume' op expects 1 child");
+ }
+ $qastcomp.as_post(QAST::Op.new(
+ :op('call'),
+ QAST::Op.new(
+ :op('atkey'),
+ $op[0],
+ QAST::SVal.new( :value('resume') )
+ )))
+});
# Control exception throwing.
my %control_map := nqp::hash(
Please sign in to comment.
Something went wrong with that request. Please try again.