## 2019 09 15.01
+ - Fixed issue RT#131115: -bli option not working correctly.
+ Closing braces were not indented in some cases due to a glitch
+ introduced in version 20181120.
+
- Fixed issue RT#130394: Allow short nested blocks. Given the following
$factorial = sub { reduce { $a * $b } 1 .. 11 };
&& defined($K_beg) )
{
my $K_next_nonblank = $self->K_next_code($K_beg);
- if ( defined($K_next_nonblank) ) {
+
+ # Patch for RT#131115: honor -bli flag at closing brace
+ my $is_bli =
+ $rOpts_brace_left_and_indent
+ && $block_type_to_go[$i_terminal]
+ && $block_type_to_go[$i_terminal] =~ /$bli_pattern/o;
+
+ if ( !$is_bli && defined($K_next_nonblank) ) {
my $lev = $rLL->[$K_beg]->[_LEVEL_];
my $level_next = $rLL->[$K_next_nonblank]->[_LEVEL_];
$adjust_indentation = 1 if ( $level_next < $lev );
--- /dev/null
+# closing braces to be inteded with -bli
+sub a {
+ my %uniq;
+ foreach my $par (@_) {
+ $uniq{$par} = 1;
+ }
+}
--- /dev/null
+# closing braces to be inteded with -bli
+sub a
+ {
+ my %uniq;
+ foreach my $par (@_)
+ {
+ $uniq{$par} = 1;
+ }
+ }
../snippets16.t almost1.def
../snippets16.t almost2.def
../snippets16.t almost3.def
+../snippets16.t rt130394.def
../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 rt130394.def
+../snippets16.t rt131115.def
+../snippets16.t rt131115.rt131115
--- /dev/null
+# closing braces to be inteded with -bli
+sub a {
+ my %uniq;
+ foreach my $par (@_) {
+ $uniq{$par} = 1;
+ }
+}
#9 almost2.def
#10 almost3.def
#11 rt130394.def
+#12 rt131115.def
+#13 rt131115.rt131115
# To locate test #13 you can search for its name or the string '#13'
# BEGIN SECTION 1: Parameter combinations #
###########################################
$rparams = {
- 'def' => "",
- 'git10' => "-wn -ce -cbl=sort,map,grep",
- 'spp1' => "-spp=1",
- 'spp2' => "-spp=2",
+ 'def' => "",
+ 'git10' => "-wn -ce -cbl=sort,map,grep",
+ 'rt131115' => "-bli",
+ 'spp1' => "-spp=1",
+ 'spp2' => "-spp=2",
};
############################
'rt130394' => <<'----------',
# rt130394: keep on one line
$factorial = sub { reduce { $a * $b } 1 .. 11 };
+----------
+
+ 'rt131115' => <<'----------',
+# closing braces to be inteded with -bli
+sub a {
+ my %uniq;
+ foreach my $par (@_) {
+ $uniq{$par} = 1;
+ }
+}
----------
'spp' => <<'----------',
$factorial = sub { reduce { $a * $b } 1 .. 11 };
#11...........
},
+
+ 'rt131115.def' => {
+ source => "rt131115",
+ params => "def",
+ expect => <<'#12...........',
+# closing braces to be inteded with -bli
+sub a {
+ my %uniq;
+ foreach my $par (@_) {
+ $uniq{$par} = 1;
+ }
+}
+#12...........
+ },
+
+ 'rt131115.rt131115' => {
+ source => "rt131115",
+ params => "rt131115",
+ expect => <<'#13...........',
+# closing braces to be inteded with -bli
+sub a
+ {
+ my %uniq;
+ foreach my $par (@_)
+ {
+ $uniq{$par} = 1;
+ }
+ }
+#13...........
+ },
};
my $ntests = 0 + keys %{$rtests};