From: Steve Hancock Date: Sun, 27 Sep 2020 18:32:44 +0000 (-0700) Subject: keep any space between a bareword and quote X-Git-Tag: 20201001~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f32553c8b4d5416d702441d4b65e1f942d18df6f;p=perltidy.git keep any space between a bareword and quote --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 90e60e96..613ddcd8 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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 =~ /^\<\ + +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 The .LOG file reports any disagreements between the indentation of the input and output files.