return $line_of_tokens;
}
- # must print line unchanged if we are in a format section
+ # Print line unchanged if we are in a format section
elsif ( $tokenizer_self->[_in_format_] ) {
if ( $input_line =~ /^\.[\s#]*$/ ) {
- write_logfile_entry("Exiting format section\n");
- $tokenizer_self->[_in_format_] = 0;
- $line_of_tokens->{_line_type} = 'FORMAT_END';
+
+ # Decrement format depth count at a '.' after a 'format'
+ $tokenizer_self->[_in_format_]--;
+
+ # This is the end when count reaches 0
+ if ( !$tokenizer_self->[_in_format_] ) {
+ write_logfile_entry("Exiting format section\n");
+ $line_of_tokens->{_line_type} = 'FORMAT_END';
+ }
}
else {
$line_of_tokens->{_line_type} = 'FORMAT';
+ if ( $input_line =~ /^\s*format\s+\w+/ ) {
+
+ # Increment format depth count at a 'format' within a 'format'
+ # This is a simple way to handle nested formats (issue c019).
+ $tokenizer_self->[_in_format_]++;
+ }
}
return $line_of_tokens;
}
=over 4
+=item B<Handle nested print format blocks>
+
+Perltidy was producing an error at nested print format blocks,
+such as
+
+ format NEST =
+ @<<<
+ {
+ my $birds = "birds";
+ local *NEST = *BIRDS{FORMAT};
+ write NEST;
+ format BIRDS =
+ @<<<<<
+ $birds;
+ .
+ "nest"
+ }
+ .
+
+It was ending the first format at the first '.' rather than the second '.' in
+this example. This update fixes this, issue c019.
+
+13 Jun 2021.
+
+
=item B<Allow stacked labels without spaces>
When labels are stacked in a single line, such as
A: B: C:
-This update allows them to be removed if desired:
+This update allows the spaces to be removed if desired:
# perltidy -naws -dws
A:B:C:
-13 Jun 2021
+13 Jun 2021, c2a63b2
=item B<Fix edge cases of instability involving -wn -lp>
unusual additional parameters. These were traced to a test for welding,
and were fixed by refining a certain tolerance. This fixes cases b1141, b1142.
-12 Jun 2021.
+12 Jun 2021, 125494b.
=item B<Remove incorrect warning at repeated function paren call>