Changeset 23025 for src

Show
Ignore:
Timestamp:
11/15/08 19:05:27 (8 weeks ago)
Author:
lwall
Message:

[Cursor] reorder fate elements

Location:
src/perl6
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/Cursor.pmc

    r23018 r23025  
    4444    my $text = ''; 
    4545    while ($f) { 
    46         $text .= $f->[0] . " " . $f->[1]; 
    47         $text .= ' ' if $f = $f->[2]; 
     46        $text .= $f->[1] . " " . $f->[2]; 
     47        $text .= ' ' if $f = $f->[0]; 
    4848    } 
    4949    $text; 
     
    331331                $FATECACHE{$fstr} = $fate = $fates->[$i] = [0,0,0]; 
    332332                while ($fstr =~ s/(\S+)\s+(\S+)\s*//) { 
    333                     $fate->[0] = $1; 
    334                     $fate->[1] = $2; 
    335                     if ($fate->[2] = $FATECACHE{$fstr}) { 
     333                    $fate->[1] = $1; 
     334                    $fate->[2] = $2; 
     335                    if ($fate->[0] = $FATECACHE{$fstr}) { 
    336336                        last; 
    337337                    } 
    338                     $fate = $fate->[2] //= [0,0,0] if $fstr ne ''; 
     338                    $fate = $fate->[0] //= [0,0,0] if $fstr ne ''; 
    339339                } 
    340340            } 
     
    365365            my $fate = $fates->[$i] = [0,0,0]; 
    366366            while ($fstr =~ s/(\S+)\s+(\S+)\s*//) { 
    367                 $fate->[0] = $1; 
    368                 $fate->[1] = $2; 
    369                 $fate = $fate->[2] = [0,0,0] if $fstr ne ''; 
     367                $fate->[1] = $1; 
     368                $fate->[2] = $2; 
     369                $fate = $fate->[0] = [0,0,0] if $fstr ne ''; 
    370370            } 
    371371            $i++; 
     
    439439                $FATECACHE{$fstr} = $fate = $fates->[$i] = [0,0,0]; 
    440440                while ($fstr =~ s/(\S+)\s+(\S+)\s*//) { 
    441                     $fate->[0] = $1; 
    442                     $fate->[1] = $2; 
    443                     if ($fate->[2] = $FATECACHE{$fstr}) { 
     441                    $fate->[1] = $1; 
     442                    $fate->[2] = $2; 
     443                    if ($fate->[0] = $FATECACHE{$fstr}) { 
    444444                        last; 
    445445                    } 
    446                     $fate = $fate->[2] //= [0,0,0] if $fstr ne ''; 
     446                    $fate = $fate->[0] //= [0,0,0] if $fstr ne ''; 
    447447                } 
    448448            } 
     
    911911 
    912912                for my $i (0..@$fates-1) { 
    913                     $self->deb("\t", $i, ': ', $fates->[$i][3]); 
     913                    $self->deb("\t", $i, ': ', fatestr($fates->[$i])); 
    914914                } 
    915915            } 
  • src/perl6/gimme5

    r23015 r23025  
    335335        my \$relex; 
    336336        if (my \$fate = \$C->{_fate}) { 
    337             if (\$fate->[0] eq '$name') { 
     337            if (\$fate->[1] eq '$name') { 
    338338                \$C->deb("Fate passed to $name: ", ::fatestr(\$fate)) if \$DEBUG & DEBUG::fates; 
    339                 (\$tag, \$try, \$fate) = \@\$fate; 
    340                 \$C->{_fate} = \$fate; 
     339                (\$C->{_fate}, \$tag, \$try) = \@\$fate; 
    341340                \@try = (\$try); 
    342341            } 
     
    353352     
    354353            if (ref \$try eq 'ARRAY') { 
    355                 (\$tag, \$try, \$C->{_fate}) = \@\$try; # next candidate fate 
     354                (\$C->{_fate}, \$tag, \$try) = \@\$try; # next candidate fate 
    356355            } 
    357356     
     
    24852484 
    24862485    my \$fate; 
    2487     if (\$fate = \$C->{_fate} and \$fate->[0] eq '$altname') { 
     2486    if (\$fate = \$C->{_fate} and \$fate->[1] eq '$altname') { 
    24882487        \$C->deb("Fate passed to $altname: ", ::fatestr(\$fate)) if \$DEBUG & DEBUG::fates; 
    2489         (\$tag, \$try, \$fate) = \@\$fate; 
    2490         \$C->{_fate} = \$fate; 
     2488        (\$C->{_fate}, \$tag, \$try) = \@\$fate; 
    24912489        \@try = (\$try); 
    24922490    } 
     
    25022500 
    25032501        if (ref \$try eq 'ARRAY') { 
    2504             (\$tag, \$try, \$C->{_fate}) = \@\$try;     # next candidate fate 
     2502            (\$C->{_fate}, \$tag, \$try) = \@\$try;     # next candidate fate 
    25052503        } 
    25062504