[svn:parrot] r44025 - branches/tt_1449/src/pmc

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Tue Feb 16 16:31:46 UTC 2010


Author: whiteknight
Date: Tue Feb 16 16:31:44 2010
New Revision: 44025
URL: https://trac.parrot.org/parrot/changeset/44025

Log:
Add use of array types to key NameSpace, on suggestion from NotFound++

Modified:
   branches/tt_1449/src/pmc/namespace.pmc

Modified: branches/tt_1449/src/pmc/namespace.pmc
==============================================================================
--- branches/tt_1449/src/pmc/namespace.pmc	Tue Feb 16 15:47:59 2010	(r44024)
+++ branches/tt_1449/src/pmc/namespace.pmc	Tue Feb 16 16:31:44 2010	(r44025)
@@ -423,6 +423,15 @@
 
             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);


More information about the parrot-commits mailing list