cvsuser     05/03/05 02:18:19

  Modified:    classes  pmc2c2.pl
  Log:
  fix pmc parent ordering
  
  Revision  Changes    Path
  1.25      +10 -4     parrot/classes/pmc2c2.pl
  
  Index: pmc2c2.pl
  ===================================================================
  RCS file: /cvs/public/parrot/classes/pmc2c2.pl,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- pmc2c2.pl 17 Jan 2005 14:02:03 -0000      1.24
  +++ pmc2c2.pl 5 Mar 2005 10:18:19 -0000       1.25
  @@ -1,7 +1,7 @@
   #! perl -w
   
   # Copyright: 2001-2005 The Perl Foundation.  All Rights Reserved.
  -# $Id: pmc2c2.pl,v 1.24 2005/01/17 14:02:03 leo Exp $
  +# $Id: pmc2c2.pl,v 1.25 2005/03/05 10:18:19 leo Exp $
   
   =head1 NAME
   
  @@ -326,13 +326,17 @@
       my ($pre, $classname) = ($1, $2);
       my %has_value = ( does => 1, extends => 1, group => 1, lib => 1 );
   
  -    my %flags;
  +    my (%flags, $parent_nr);
       # look through the pmc declaration header for flags such as noinit
       while ($$c =~ s/^(?:\s*)(\w+)//s) {
        if ($has_value{$1}) {
            my $what = $1;
            if (s/^(?:\s+)(\w+)//s) {
  -             $flags{$what}{$1} = 1;
  +                if ($what eq 'extends') {
  +                    $flags{$what}{$1} = ++$parent_nr;
  +                } else {
  +                    $flags{$what}{$1} = 1;
  +                }
            }
            else {
                die "Parser error: no value for '$what'";
  @@ -434,7 +438,9 @@
           my $n = shift @todo;
           my $sub = $all->{$n};
           next if $n eq 'default';
  -        foreach my $parent (keys %{$sub->{flags}{extends}}) {
  +        my %parent_hash = %{$sub->{flags}{extends}};
  +        foreach my $parent (sort {$parent_hash{$a} <=> $parent_hash{$b} }
  +                (keys (%parent_hash) ) ) {
               next if exists $class->{has_parent}{$parent};
               if (!$all->{$parent}) {
                   my $pf = lc $parent;
  
  
  

Reply via email to