scan_bare_identifier();
},
'<<' => sub { # maybe a here-doc?
- return
- unless ( $i < $max_token_index )
- ; # here-doc not possible if end of line
+
+## This check removed because it could be a deprecated here-doc with
+## no specified target. See example in log 16 Sep 2020.
+## return
+## unless ( $i < $max_token_index )
+## ; # here-doc not possible if end of line
if ( $expecting != OPERATOR ) {
my ( $found_target, $here_doc_target, $here_quote_character,
my $truncated = substr( $here_doc_target, 0, 80 );
complain("Long here-target: '$truncated' ...\n");
}
+ elsif ( !$here_doc_target ) {
+ warning(
+ 'Use of bare << to mean <<"" is deprecated\n');
+ }
elsif ( $here_doc_target !~ /^[A-Z_]\w+$/ ) {
complain(
"Unconventional here-target: '$here_doc_target'\n");
=over
+=item B<fix incorrect parsing of certain deprecated empty here-docs >
+
+The following snippet was being incorrecly parsed:
+
+ print <<
+ # Hello World 13!
+
+ ;
+ print "DONE\n";
+
+This is a deprecated here-doc without a specified target but currently still a
+valid program. It would have been correctly parsed if the semicolon followed
+the '<<' operator rather than the here-doc.
+
+This was found in random testing and fixed 16 Sep 2020. A warning message about
+deprecated here-doc targets was added.
+
=item B<make the arrow a vertical alignment token, git #39>
The -> can now be vertically aligned if a space is placed before it with -wls='->'.