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

Will Coleda will at coleda.com
Tue Sep 29 12:48:15 UTC 2009


We don't want to be exposing the integer value of the current HLL, but
the string name.

On Tue, Sep 29, 2009 at 8:00 AM,  <bacek at svn.parrot.org> wrote:
> Author: bacek
> Date: Tue Sep 29 12:00:14 2009
> New Revision: 41553
> URL: https://trac.parrot.org/parrot/changeset/41553
>
> Log:
> [core] Expose Context.current_HLL into PIR
>
> 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 11:42:40 2009        (r41552)
> +++ trunk/src/pmc/context.pmc   Tue Sep 29 12:00:14 2009        (r41553)
> @@ -176,6 +176,10 @@
>             return ctx->current_namespace;
>         else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "handlers")))
>             return ctx->handlers;
> +        else if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "current_HLL")))
> +            /* This function from src/hash.c. */
> +            /* We probably have to move it to more suitable place */
> +            return get_integer_pmc(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 11:42:40 2009        (r41552)
> +++ trunk/t/pmc/context.t       Tue Sep 29 12:00:14 2009        (r41553)
> @@ -18,10 +18,12 @@
>
>  =cut
>
> +.HLL 'FOO'
> +
>  .sub main :main
>     .include 'test_more.pir'
>
> -    plan(15)
> +    plan(16)
>
>     test_new()
>
> @@ -114,6 +116,10 @@
>     pop_eh
>     ok($I0, "No world domination in this Context")
>
> +    # Current HLL shouldn't be zero
> +    $P0 = ctx['current_HLL']
> +    $I0 = $P0
> +    ok($I0, 'Got Context.current_HLL')
>
>   done:
>     pop_eh
> _______________________________________________
> http://lists.parrot.org/mailman/listinfo/parrot-commits
>



-- 
Will "Coke" Coleda


More information about the parrot-commits mailing list