]> git.donarmstrong.com Git - perltidy.git/commitdiff
keep any space between a bareword and quote
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 27 Sep 2020 18:32:44 +0000 (11:32 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 27 Sep 2020 18:32:44 +0000 (11:32 -0700)
lib/Perl/Tidy/Formatter.pm
local-docs/BugLog.pod

index 90e60e961f8059a96b0e2ec7c62ecc2888bb5968..613ddcd8ecbbda916613098ad0b06fb842e9c7f1 100644 (file)
@@ -2216,7 +2216,11 @@ EOM
           #     -data => $data;
           # This is the safest thing to do. If we had the token to the right of
           # the minus we could do a better check.
-          || $tokenr eq '-' && $typel eq 'w'
+          #
+          # And do not combine a bareword and a quote, like this:
+          #    oops "Your login, $Bad_Login, is not valid";
+          # It can cause a syntax error if oops is a sub
+          || $typel eq 'w' && ($tokenr eq '-' || $typer eq 'Q') 
 
           # perl is very fussy about spaces before <<
           || $tokenr =~ /^\<\</
index 86f6eff0dfdc8c168dac5578e7694fcf8b63df4e..51d592ae6a5ca29e3dfa271b5fe71abfeccdddcb 100644 (file)
@@ -5,6 +5,16 @@ found with the help of automated random testing.
 
 =over
 
+
+=item B<Keep any space between a bareword and quote>
+
+In random testing, the -mangle option introduced a syntax error by deleting
+the space between barewords and quotes (test file 'MxScreen'), such as:
+
+  oops"Your login, $Bad_Login, is not valid";
+
+Sub is_essential_whitespace was updated to prevent this on 27 Sep 2020.
+
 =item B<Fixed some incorrect indentation disagreements reported in LOG file> 
 
 The .LOG file reports any disagreements between the indentation of the input and output files.