Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Code object mapping support.
  • Loading branch information
jnthn committed Apr 9, 2013
1 parent 6b1f913 commit 5f9c348
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/6model/sixmodelobject.c
Expand Up @@ -291,6 +291,17 @@ PMC * hllize(PARROT_INTERP, PMC *obj, INTVAL hll_id) {
return obj;
}
}
else if (obj->vtable->base_type == enum_class_Sub) {
if (VTABLE_exists_keyed_str(interp, config, Parrot_str_new_constant(interp, "foreign_transform_code"))) {
PMC *result;
PMC *code = VTABLE_get_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "foreign_transform_code"));
Parrot_ext_call(interp, code, "P->P", obj, &result);
return result;
}
else {
return obj;
}
}
else if (obj->vtable->base_type == enum_class_Null) {
if (VTABLE_exists_keyed_str(interp, config, Parrot_str_new_constant(interp, "null_value")))
return VTABLE_get_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "null_value"));
Expand Down
12 changes: 8 additions & 4 deletions src/ops/nqp.ops
Expand Up @@ -2985,10 +2985,6 @@ inline op nqp_sethllconfig(out PMC, in STR, invar PMC) {
VTABLE_set_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "foreign_type_str"),
VTABLE_get_pmc_keyed_str(interp, $3, Parrot_str_new_constant(interp, "foreign_type_str")));
}
if (VTABLE_exists_keyed_str(interp, $3, Parrot_str_new_constant(interp, "foreign_type_any"))) {
VTABLE_set_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "foreign_type_any"),
VTABLE_get_pmc_keyed_str(interp, $3, Parrot_str_new_constant(interp, "foreign_type_any")));
}

if (VTABLE_exists_keyed_str(interp, $3, Parrot_str_new_constant(interp, "foreign_transform_int"))) {
VTABLE_set_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "foreign_transform_int"),
Expand All @@ -3010,6 +3006,14 @@ inline op nqp_sethllconfig(out PMC, in STR, invar PMC) {
VTABLE_set_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "foreign_transform_hash"),
VTABLE_get_pmc_keyed_str(interp, $3, Parrot_str_new_constant(interp, "foreign_transform_hash")));
}
if (VTABLE_exists_keyed_str(interp, $3, Parrot_str_new_constant(interp, "foreign_transform_code"))) {
VTABLE_set_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "foreign_transform_code"),
VTABLE_get_pmc_keyed_str(interp, $3, Parrot_str_new_constant(interp, "foreign_transform_code")));
}
if (VTABLE_exists_keyed_str(interp, $3, Parrot_str_new_constant(interp, "foreign_transform_any"))) {
VTABLE_set_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "foreign_transform_any"),
VTABLE_get_pmc_keyed_str(interp, $3, Parrot_str_new_constant(interp, "foreign_transform_any")));
}

if (VTABLE_exists_keyed_str(interp, $3, Parrot_str_new_constant(interp, "null_value"))) {
VTABLE_set_pmc_keyed_str(interp, config, Parrot_str_new_constant(interp, "null_value"),
Expand Down

0 comments on commit 5f9c348

Please sign in to comment.