Skip to content

Commit

Permalink
Add use of array types to key NameSpace, on suggestion from NotFound++
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/branches/tt_1449@44025 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
whiteknight committed Feb 16, 2010
1 parent c915fc6 commit 12c157f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pmc/namespace.pmc
Expand Up @@ -423,6 +423,15 @@ really a public API.

return VTABLE_get_pmc_keyed(INTERP, ns, key);
}
else if (VTABLE_does(INTERP, key, CONST_STRING(INTERP, "array"))) {
INTVAL i = 0;
while (!PMC_IS_NULL(ns) && VTABLE_elements(INTERP, key)) {
STRING * const name = VTABLE_get_string_keyed_int(INTERP, key, i);
ns = Parrot_get_namespace_keyed_str(INTERP, ns, name);
i++;
}
return ns;
}
else {
STRING * const name = VTABLE_get_string(INTERP, key);
ns = Parrot_get_namespace_keyed_str(INTERP, ns, name);
Expand Down

0 comments on commit 12c157f

Please sign in to comment.