New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#246 CHECK bareword handle parsed as scheduled block #247
Conversation
followed by '{' or ';'. Otherwise it is not parsed as a scheduled block. I have run both modified and unmodified PPI against all of CPAN, looking for instances of PPI::Statement::Scheduled where the keyword is not followed by a block. All the differences were either irrelevant (stuff like temporary directory names, or non-Perl (i.e. filters)), or statements like open( CHECK, ... ) which disappeared when the new code was used.
Any chance of this being accepted? Or rejected? I submitted it back in February, and then completely forgot about it until I got my cage rattled on the original Perl::Critic issue, to wit [https://github.com/Perl-Critic/Perl-Critic/issues/878]. |
Sorry, i'll try and have a look tomorrow. :) |
Nudge? |
Closing and re-opening to trigger CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This looks ok if the tests pass after rebasing. The stray newline can probably go? There should be an additional ticket to verify that this stuff behaves well for all of these: https://perldoc.perl.org/perlmod#BEGIN,-UNITCHECK,-CHECK,-INIT-and-END |
I have a rebased branch and will merge at the command line if the checks pass. |
The fix ensures that a the keyword for a prospective scheduled block is followed by '{' or ';'. Otherwise it is not parsed as a scheduled block.
I have run both modified and unmodified PPI against all of CPAN, looking for instances of PPI::Statement::Scheduled where the keyword is not followed by a block. All the differences were either irrelevant (stuff like temporary directory names, or non-Perl (i.e. filters)), or
statements like
open( CHECK, ... )
which disappeared when the new code was used.