Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix compile time error where parentheses were against keywords such a…

…s my or while.
  • Loading branch information...
commit cbe97b83479794a2383f83ba1c5d7a1eb4abfc37 1 parent cfd2baf
@Takadonet authored
Showing with 7 additions and 7 deletions.
  1. +3 −3 lib/Algorithm/Diff.pm
  2. +4 −4 t/oo.t
View
6 lib/Algorithm/Diff.pm
@@ -442,12 +442,12 @@ sub compact_diff( @a, @b, &keyGen = &default_keyGen ) is export
push @cdiff, $ai, $bi;
while ( 1 )
{
- while( $am && $ai == $am.[0] && $bi == $bm.[0] )
+ while ( $am && $ai == $am.[0] && $bi == $bm.[0] )
{
shift $am;
shift $bm;
++$ai, ++$bi;
- }
+ }
push @cdiff, $ai, $bi;
last if !$am;
$ai = $am.[0];
@@ -501,7 +501,7 @@ has $_Min = -2; # Added to _Off to get min instead of max+1
method new ( @seq1, @seq2, &keyGen = &default_keyGen ) {
my @cdif = &compact_diff( @seq1, @seq2, &keyGen );
my $same = 1;
- if( 0 == @cdif[2] && 0 == @cdif[3] ) {
+ if ( 0 == @cdif[2] && 0 == @cdif[3] ) {
$same = 0;
@cdif.splice( 0, 2 );
}
View
8 t/oo.t
@@ -10,7 +10,7 @@ use Algorithm::Diff;
my $undef;
-my( $a, $b, $hunks );
+my ( $a, $b, $hunks );
for (
[ "a b c e h j l m n p", " b c d e f j k l m r s t", 9 ],
[ "", "", 0 ],
@@ -102,7 +102,7 @@ for (
is( $c.Next(0), $d.Next(0), 'Copy with parameters iterates correctly' );
$d.Reset();
- my( @A, @B );
+ my ( @A, @B );
# The two tests in the following group marked with the comments are different
# from the perl5 tests. .Same and .Items return elements and .Range returns
@@ -110,9 +110,9 @@ for (
# would pass as long as they both were the same size. Now they check to see if
# they have the same contents.
- while( $d.Next ) {
+ while ( $d.Next ) {
my $i = 1;
- if( $d.Same ) {
+ if ( $d.Same ) {
is( $d.Diff, 0, "if loop sequence #{$i++}" );
is( $d.Same, @b[$d.Range(2)], "if loop sequence #{$i++}" ); # different from perl 5 !!
is( $d.Items(2), @a[$d.Range(1)], "if loop sequence #{$i++}" ); # different from perl 5 !!
Please sign in to comment.
Something went wrong with that request. Please try again.