]> git.donarmstrong.com Git - perltidy.git/commitdiff
Fix error parsing '&#'
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 6 Jul 2021 02:54:33 +0000 (19:54 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 6 Jul 2021 02:54:33 +0000 (19:54 -0700)
lib/Perl/Tidy/Tokenizer.pm
local-docs/BugLog.pod

index ae4615eb376f0e9d7c330a74e659ac7c11c73fc9..99b0a9198902e382b29db645f351221a5484ac79 100644 (file)
@@ -7177,7 +7177,9 @@ sub scan_identifier_do {
                 #   Prima::PodView::COLOR_CODE_FOREGROUND
                 #   & ~tb::COLOR_INDEX ] =
                 #   $sec->{ColorCode}
-                if ( $identifier eq '&' && $expecting ) {
+
+                # Fix for case c033: a '#' here starts a side comment
+                if ( $identifier eq '&' && $expecting && $tok ne '#' ) {
                     $identifier .= $tok;
                 }
                 else {
index 4177298b7392be10f5ac8d0a07b37267c5a898bb..4703e7fe6f621b34e8635953d7e64d25ed85b4e4 100644 (file)
@@ -2,6 +2,23 @@
 
 =over 4
 
+=item B<Fix error parsing '&#'>
+
+The following test script caused an error when perltidy did not correctly parse
+the tight side comment after the '&' (it parsed correctly if there was a space
+before the '#').
+
+    print$my_bag
+    &#sc#
+    $your_bag
+    ,
+    "\n"
+    ;
+
+This update fixes this issue, c033.
+
+5 Jul 2021.
+
 =item B<Fix error parsing format statement>
 
 The following test script caused an error when perltidy took 'format' to