From 0d784e0be496e8a89575f77a5bc15085a2ed8ee1 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 5 Jul 2021 19:54:33 -0700 Subject: [PATCH] Fix error parsing '&#' --- lib/Perl/Tidy/Tokenizer.pm | 4 +++- local-docs/BugLog.pod | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) 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 -- 2.39.5