-
Notifications
You must be signed in to change notification settings - Fork 102
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
Parsing bug for return statement #451
Comments
RT Ticket: http://rt.cpan.org/Ticket/Display.html?id=72737 On Sat Nov 26 09:24:22 2011, jdeighan wrote:
You don't say what warnings you object to, but running your example I Subroutine "f" does not end with "return" at line 16, column 1. See The line in question is return'ProposedOverdue.png'; Perl::Critic relies on PPI to do its parsing for it, and the PPI parse
[ 16, 1, 1 ] PPI::Token::Word 'sub' In other words, without the space after the 'return', PPI thinks that it You can try filing a ticket against PPI, referring to this one. But this Tom |
RT Ticket: http://rt.cpan.org/Ticket/Display.html?id=72737 Actually, I got both of these warnings: Subroutine "f" does not end with "return" at line 19, column 1. See More importantly, though, when I run the script, the function returns On Sat, Nov 26, 2011 at 4:41 PM, Tom Wyant via RT
|
RT Ticket: http://rt.cpan.org/Ticket/Display.html?id=72737 On Mon Nov 28 14:20:53 2011, jdeighan wrote:
Thanks. Here is where I think the second one came from. One of PPI's explicit goals it to be round-trip safe. That is, if you So when PPI decided to parse "return'ProposedOverdue.png';" as Perl 4
This argument has been made before. The counter-example I had in mind The true situation is that Perl is only right until the Perl maintainers
Thank you. And thank you for submitting your report. You found something
Well, I confess my opinion that fixing this may take an amount of time It is known that you can not statically parse Perl. That is, you can not But this is what PPI tries to do. Usually it does it pretty well. But if |
A fix for this has been released as a dev version to CPAN. Please test and give feedback here: |
This is fixed in the next release of PPI via Perl-Critic/PPI#92
This is fixed in the next release of PPI via Perl-Critic/PPI#92
The full version of the fix for this is now released to CPAN as PPI 1.220. |
This is fixed in Perl-Critic-1.123 via PPI-1.220 |
RT Ticket: http://rt.cpan.org/Ticket/Display.html?id=72737
Requested On: Sat Nov 26 06:24:22 2011
Requested By: john.deighan@gmail.com
The attached file compiles just fine, but Perl::Critic gives incorrect
warnings, apparently because the return statement doesn't have
whitespace between the word 'return' and the following string literal.
The text was updated successfully, but these errors were encountered: