Skip to content

Commit

Permalink
Add nqp::resume(...) for resuming an exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Mar 15, 2013
1 parent 47effd6 commit cfdcc70
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/QAST/Operations.nqp
Expand Up @@ -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(
Expand Down

0 comments on commit cfdcc70

Please sign in to comment.