- Timestamp:
- 11/15/08 19:05:27 (8 weeks ago)
- Location:
- src/perl6
- Files:
-
- 2 modified
-
Cursor.pmc (modified) (5 diffs)
-
gimme5 (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/perl6/Cursor.pmc
r23018 r23025 44 44 my $text = ''; 45 45 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]; 48 48 } 49 49 $text; … … 331 331 $FATECACHE{$fstr} = $fate = $fates->[$i] = [0,0,0]; 332 332 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}) { 336 336 last; 337 337 } 338 $fate = $fate->[ 2] //= [0,0,0] if $fstr ne '';338 $fate = $fate->[0] //= [0,0,0] if $fstr ne ''; 339 339 } 340 340 } … … 365 365 my $fate = $fates->[$i] = [0,0,0]; 366 366 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 ''; 370 370 } 371 371 $i++; … … 439 439 $FATECACHE{$fstr} = $fate = $fates->[$i] = [0,0,0]; 440 440 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}) { 444 444 last; 445 445 } 446 $fate = $fate->[ 2] //= [0,0,0] if $fstr ne '';446 $fate = $fate->[0] //= [0,0,0] if $fstr ne ''; 447 447 } 448 448 } … … 911 911 912 912 for my $i (0..@$fates-1) { 913 $self->deb("\t", $i, ': ', $fates->[$i][3]);913 $self->deb("\t", $i, ': ', fatestr($fates->[$i])); 914 914 } 915 915 } -
src/perl6/gimme5
r23015 r23025 335 335 my \$relex; 336 336 if (my \$fate = \$C->{_fate}) { 337 if (\$fate->[ 0] eq '$name') {337 if (\$fate->[1] eq '$name') { 338 338 \$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; 341 340 \@try = (\$try); 342 341 } … … 353 352 354 353 if (ref \$try eq 'ARRAY') { 355 (\$ tag, \$try, \$C->{_fate}) = \@\$try; # next candidate fate354 (\$C->{_fate}, \$tag, \$try) = \@\$try; # next candidate fate 356 355 } 357 356 … … 2485 2484 2486 2485 my \$fate; 2487 if (\$fate = \$C->{_fate} and \$fate->[ 0] eq '$altname') {2486 if (\$fate = \$C->{_fate} and \$fate->[1] eq '$altname') { 2488 2487 \$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; 2491 2489 \@try = (\$try); 2492 2490 } … … 2502 2500 2503 2501 if (ref \$try eq 'ARRAY') { 2504 (\$ tag, \$try, \$C->{_fate}) = \@\$try; # next candidate fate2502 (\$C->{_fate}, \$tag, \$try) = \@\$try; # next candidate fate 2505 2503 } 2506 2504
