## 2019 09 15.01
- - implement issue RT#130640: Allow different subroutine keywords.
+ - Implement issue RT#130640: Allow different subroutine keywords.
Added a flag --sub-alias-list=s or -sal=s, where s is a string with
one or more aliases for 'sub', separated by spaces or commas.
For example,
sub usage(); # i=1 [default; follows input]
sub usage (); # i=2 [space]
- - fixed issue git#16, minor vertical alignment issue.
+ - Fixed issue git#16, minor vertical alignment issue.
+
+ - Fixed issue git#10, minor conflict of -wn and -ce
+
+ - Improved some vertical alignments involving two lines.
- - fixed issue git#10, minor conflict of -wn and -ce
## 2019 09 15
}
}
- # Leave two lines alone unless they are an if/else or ternary pair.
- # Alignment of just two lines can be annoying, so it is best to let the
- # two-line rules decide if they should be aligned.
- next if ( $nlines <= 2 && !$is_full_block );
+ # OLD: Leave two lines alone unless they are an if/else or ternary.
+ # NEW: Treat two lines the same as longer runs; results are better.
+ ## next if ( $nlines <= 2 && !$is_full_block );
# remove unwanted alignment tokens
for ( my $jj = $jbeg ; $jj <= $jend ; $jj++ ) {
# two lines with large gap but same lhs pattern so align equals
local (@pieces) = split( /\./, $filename, 2 );
local ($just_dir_and_base) = $pieces[0];
+
+# two lines with 3 alignment tokens
+$expect = "1$expect" if $expect =~ /^e/i;
+$p = "1$p" if defined $p and $p =~ /^e/i;
+
+# two lines where alignment causes a large gap
+is( eval { sysopen( my $ro, $foo, &O_RDONLY | $TAINT0 ) }, undef );
+is( $@, '' );
# two lines with large gap but same lhs pattern so align equals
local (@pieces) = split( /\./, $filename, 2 );
local ($just_dir_and_base) = $pieces[0];
+
+# two lines with 3 alignment tokens
+$expect = "1$expect" if $expect =~ /^e/i;
+$p = "1$p" if defined $p and $p =~ /^e/i;
+
+# two lines where alignment causes a large gap
+is( eval { sysopen( my $ro, $foo, &O_RDONLY | $TAINT0 ) }, undef );
+is( $@, '' );
#!/usr/bin/perl -w
-use strict; # with -kgb, no break after hash bang
+use strict; # with -kgb, no break after hash bang
our ( @Changed, $TAP ); # break after isolated 'our'
use File::Compare;
use Symbol;
#!/usr/bin/perl -w
-use strict; # with -kgb, no break after hash bang
+use strict; # with -kgb, no break after hash bang
our ( @Changed, $TAP ); # break after isolated 'our'
use File::Compare;
../snippets16.t spp.spp1
../snippets16.t spp.spp2
../snippets16.t git16.def
+../snippets16.t git10.def
+../snippets16.t git10.git10
../snippets2.t angle.def
../snippets2.t arrows1.def
../snippets2.t arrows2.def
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
-../snippets16.t git10.def
-../snippets16.t git10.git10
# two lines with large gap but same lhs pattern so align equals
local (@pieces) = split( /\./, $filename, 2 );
local ($just_dir_and_base) = $pieces[0];
+
+# two lines with 3 alignment tokens
+$expect = "1$expect" if $expect =~ /^e/i;
+$p = "1$p" if defined $p and $p =~ /^e/i;
+
+# two lines where alignment causes a large gap
+is( eval { sysopen( my $ro, $foo, &O_RDONLY | $TAINT0 ) }, undef );
+is( $@, '' );
----------
'align22' => <<'----------',
# two lines with large gap but same lhs pattern so align equals
local (@pieces) = split( /\./, $filename, 2 );
local ($just_dir_and_base) = $pieces[0];
+
+# two lines with 3 alignment tokens
+$expect = "1$expect" if $expect =~ /^e/i;
+$p = "1$p" if defined $p and $p =~ /^e/i;
+
+# two lines where alignment causes a large gap
+is( eval { sysopen( my $ro, $foo, &O_RDONLY | $TAINT0 ) }, undef );
+is( $@, '' );
#13...........
},
params => "def",
expect => <<'#10...........',
#!/usr/bin/perl -w
-use strict; # with -kgb, no break after hash bang
+use strict; # with -kgb, no break after hash bang
our ( @Changed, $TAP ); # break after isolated 'our'
use File::Compare;
use Symbol;
params => "kgb",
expect => <<'#11...........',
#!/usr/bin/perl -w
-use strict; # with -kgb, no break after hash bang
+use strict; # with -kgb, no break after hash bang
our ( @Changed, $TAP ); # break after isolated 'our'
use File::Compare;