[svn:parrot] r41556 - in trunk: src/pmc t/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Sep 29 13:02:57 UTC 2009


Author: bacek
Date: Tue Sep 29 13:02:53 2009
New Revision: 41556
URL: https://trac.parrot.org/parrot/changeset/41556

Log:
[core] Implement Context.current_hll to fetch stringified current_HLL

Modified:
   trunk/src/pmc/context.pmc
   trunk/t/pmc/context.t

Modified: trunk/src/pmc/context.pmc
==============================================================================
--- trunk/src/pmc/context.pmc	Tue Sep 29 12:44:38 2009	(r41555)
+++ trunk/src/pmc/context.pmc	Tue Sep 29 13:02:53 2009	(r41556)
@@ -181,6 +181,8 @@
             /* This function from src/hash.c. */
             /* We probably have to move it to more suitable place */
             return get_integer_pmc(INTERP, ctx->current_HLL);
+        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "current_hll")))
+            return get_string_pmc(INTERP, Parrot_get_HLL_name(INTERP, ctx->current_HLL));
 
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND,
                 "No such item %Ss", key);

Modified: trunk/t/pmc/context.t
==============================================================================
--- trunk/t/pmc/context.t	Tue Sep 29 12:44:38 2009	(r41555)
+++ trunk/t/pmc/context.t	Tue Sep 29 13:02:53 2009	(r41556)
@@ -30,7 +30,7 @@
     $P0 = get_hll_global ['Foo'], 'load'
     $P0()
     $P0 = new ['Foo']
-    $P0.'test_inspect'() # 15 tests
+    $P0.'test_inspect'() # 16 tests
 
     test_backtrace()     # 3 tests
 .end
@@ -121,6 +121,9 @@
     $P0 = ctx['current_HLL']
     $I0 = $P0
     ok($I0, 'Got Context.current_HLL')
+    
+    $P0 = ctx['current_hll']
+    ok($P0, 'FOO', 'Got Context.current_hll')
 
   done:
     pop_eh


More information about the parrot-commits mailing list