if ( $last_nonblank_token eq '->' ) {
scan_bare_identifier();
- # Patch for c043, part 4; use type 'w' after a '->'
- # This is just a safety check on sub scan_bare_identifier, which
- # should get this case correct.
+ # Patch for c043, part 4; use type 'w' after a '->'.
+ # This is just a safety check on sub scan_bare_identifier,
+ # which should get this case correct.
$type = 'w';
next;
}
}
else {
- if ( $next_nonblank_token =~ /^\s*$/ ) {
+ # Added '#' to fix issue c044
+ if ( $next_nonblank_token =~ /^\s*$/
+ || $next_nonblank_token eq '#' )
+ {
$is_pattern = 0;
}
else {
=over 4
+=item B<Fix problem with side comment after pattern>
+
+Testing with randomly placed side comments produced an error illustrated
+with the following snippet:
+
+ testit
+ /A (*THEN) X | B (*THEN) C/x#sc#
+ ,
+ "Simple (*THEN) test"
+ ;
+
+If 'testit' is an unknown bareword then perltidy has to guess
+if the '/' is a division or can start a pattern. In this case the side
+comment caused a bad guess. This is case c044 and is fixed with this update.
+There are no other known issues with side comments at the present time
+but testing continues.
+
+13 Jul 2021.
+
+
=item B<Fix problem with side comment after pointer, part 3>
This update fixes some incorrect tokenization produced by a side comment