From: Steve Hancock Date: Tue, 6 Jul 2021 02:54:33 +0000 (-0700) Subject: Fix error parsing '&#' X-Git-Tag: 20210625.02~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0d784e0be496e8a89575f77a5bc15085a2ed8ee1;p=perltidy.git Fix error parsing '&#' --- diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index ae4615eb..99b0a919 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -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 { diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 4177298b..4703e7fe 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,23 @@ =over 4 +=item B + +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 The following test script caused an error when perltidy took 'format' to