Author: coke
Date: Fri May 18 11:41:06 2007
New Revision: 18584

Modified:
   trunk/   (props changed)
   trunk/lib/Parrot/Pmc2c.pm

Log:
[pmc]

* Allow a HLL pmc to map to more than one top level type using the 'maps'
attribute in the pmclass declaration.



Modified: trunk/lib/Parrot/Pmc2c.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c.pm   (original)
+++ trunk/lib/Parrot/Pmc2c.pm   Fri May 18 11:41:06 2007
@@ -976,7 +976,6 @@
     if ( $self->{flags}{hll} && $self->{flags}{maps} ) {
 
         my $hll  = ( keys %{ $self->{flags}{hll} } )[0];
-        my $maps = ( keys %{ $self->{flags}{maps} } )[0];
         $cout .= <<"EOC";
 
         {
@@ -985,9 +984,19 @@
                 interp, const_string(interp, "$hll")
             );
             if (pmc_id > 0)
+EOC
+
+
+        foreach my $map ( keys %{ $self->{flags}{maps} }) {
+
+        $cout .= <<"EOC";
                 Parrot_register_HLL_type(
-                    interp, pmc_id, enum_class_$maps, entry
+                    interp, pmc_id, enum_class_$map, entry
                 );
+EOC
+        }
+
+        $cout .= <<"EOC";
         } /* Register */
 EOC
     }

Reply via email to