Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add nqp::getcodecuid and nqp::forceouterctx.
  • Loading branch information
jnthn committed Feb 27, 2013
1 parent 9acc219 commit 3b3d8bb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/QAST/Operations.nqp
Expand Up @@ -1825,6 +1825,15 @@ QAST::Operations.add_core_pirop_mapping('getcodeobj', 'get_sub_code_object', 'PP
QAST::Operations.add_core_pirop_mapping('setcodeobj', 'set_sub_code_object', '1PP');
QAST::Operations.add_core_pirop_mapping('getcodename', 'set', 'SP');
QAST::Operations.add_core_pirop_mapping('setcodename', 'assign', '1Ps');
QAST::Operations.add_core_op('getcodecuid', -> $qastcomp, $op {
if +@($op) != 1 {
nqp::die('getcodecuid requires one operand');
}
$qastcomp.as_post(QAST::Op.new(
:op('callmethod'), :name('get_subid'),
$op[0]
))
});
QAST::Operations.add_core_op('setstaticlex', -> $qastcomp, $op {
if +@($op) != 3 {
nqp::die('setstaticlex requires three operands');
Expand Down Expand Up @@ -1852,6 +1861,15 @@ QAST::Operations.add_core_op('setstaticlex', -> $qastcomp, $op {
)
))
});
QAST::Operations.add_core_op('forceouterctx', -> $qastcomp, $op {
if +@($op) != 2 {
nqp::die('forceouterctx requires two operands');
}
$qastcomp.as_post(QAST::Op.new(
:op('callmethod'), :name('set_outer_ctx'),
$op[0], $op[1]
))
});
QAST::Operations.add_core_pirop_mapping('freshcoderef', 'nqp_fresh_stub', 'PP');
QAST::Operations.add_core_pirop_mapping('replacecoderef', 'assign', '0PP');
QAST::Operations.add_core_op('markcodestatic', -> $qastcomp, $op {
Expand Down

0 comments on commit 3b3d8bb

Please sign in to comment.