Permalink
Browse files

Implement sethllconfig.

  • Loading branch information...
1 parent a82ef51 commit d52f45d8971833c333f3325d0e6f80380a9c9edd @arnsholt arnsholt committed Mar 24, 2013
Showing with 12 additions and 6 deletions.
  1. +1 −6 src/QAST/Operations.nqp
  2. +11 −0 src/ops/nqp.ops
@@ -2043,12 +2043,7 @@ QAST::Operations.add_core_op('bindhllsym', -> $qastcomp, $op {
$op[2]
))
});
-QAST::Operations.add_core_op('sethllconfig', -> $qastcomp, $op {
- # XXX Not really implemented here.
- my $ops := PIRT::Ops.new();
- $ops.result('0');
- $ops
-});
+QAST::Operations.add_core_pirop_mapping('sethllconfig', 'sethllconfig', 'PSP');
# regex engine related opcodes
QAST::Operations.add_core_pirop_mapping('nfafromstatelist', 'nqp_nfa_from_statelist', 'PPP');
View
@@ -380,6 +380,17 @@ inline op nqp_dynop_setup() :base_core {
}
}
+inline op sethllconfig(out PMC, in STR, invar PMC) {
+ PMC *config = get_hll_config(interp, $2);
+
+ if (VTABLE_exists_keyed_str(interp, $3, Parrot_str_new_constant(interp, "list"))) {
+ VTABLE_set_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "listType"),
+ VTABLE_get_pmc_keyed_str(interp, $3, Parrot_str_new_constant(interp, "list")));
+ }
+
+ $1 = config;
+}
+
/*

0 comments on commit d52f45d

Please sign in to comment.