[svn:parrot] r36570 - in trunk: ext/Parrot-Embed/lib/Parrot ext/Parrot-Embed/t src src/dynpmc src/ops src/pmc t/oo t/pmc

chromatic chromatic at wgz.org
Wed Feb 11 09:03:41 UTC 2009


On Tuesday 10 February 2009 17:53:00 Infinoid at svn.parrot.org wrote:

> Log:
> Revert "Merge vtable_morph_change branch changes back into trunk."

> Modified: trunk/ext/Parrot-Embed/lib/Parrot/Embed.xs
> ===========================================================================
>--- trunk/ext/Parrot-Embed/lib/Parrot/Embed.xs	Wed Feb 11 01:44:02
> 2009	(r36569) +++ trunk/ext/Parrot-Embed/lib/Parrot/Embed.xs	Wed Feb 11
> 01:52:58 2009	(r36570) @@ -130,15 +130,46 @@
>      real_interp     = interp->interp;
>      p_global        = Parrot_str_new_constant( real_interp, global );
>
> -    if ( items == 3 )
> +    if (items == 3)
>          namespace   = ST(2);
>      else
>          namespace   = &PL_sv_undef;
>
>      if (namespace  != &PL_sv_undef )
>      {
> -        p_namespace = Parrot_str_new_constant( real_interp,
> SvPVX(namespace) ); -        pmc         =
> Parrot_find_global_s(real_interp, p_namespace, p_global); +        char
> *ns_copy = savepv(SvPV_nolen(namespace));
> +        char *ns_str  = ns_copy;
> +        char *prev    = ns_str;
> +        PMC  *ns      = NULL;
> +
> +        while (*ns_str++)
> +        {
> +            STRING *ns_part;
> +
> +            if (! (*ns_str == ':' && *(ns_str + 1) == ':'))
> +                continue;
> +
> +            *ns_str = 0;
> +            ns_str += 2;
> +
> +            if (!ns)
> +                ns = Parrot_find_global_cur(real_interp,
> +                    Parrot_str_new_constant(real_interp, prev));
> +            else
> +                ns = Parrot_find_global_n(real_interp, ns,
> +                    Parrot_str_new_constant(real_interp, prev));
> +            prev    = ns_str;
> +        }
> +
> +        if (!ns)
> +            ns = Parrot_find_global_cur(real_interp,
> +                Parrot_str_new_constant(real_interp, prev));
> +        else
> +            ns = Parrot_find_global_n(real_interp, ns,
> +                Parrot_str_new_constant(real_interp, prev));
> +
> +        pmc          = Parrot_find_global_n(real_interp, ns, p_global);
> +        Safefree(ns_copy);
>      }
>      else
>          pmc         = Parrot_find_global_cur( real_interp, p_global );

Be careful with the merge, as the changes to Parrot::Embed were wrong.  The 
branch shouldn't touch Parrot::Embed at all; it has never used morph.

-- c


More information about the parrot-dev mailing list