stevan / p5-App-Critique

An incremental refactoring tool for Perl powered by Perl::Critic
3 stars 4 forks source link

critique doesn't recover from perlcritic crash #28

Open flimzy opened 8 years ago

flimzy commented 8 years ago

If perl critic crashes, critique doesn't recover.

To reproduce, create a perl script that chokes perlcritic (e.g. use an unquoted non-ASCII key name in a hash):

#!/usr/bin/perl
use utf8;
my $foo = { fó => 3 };

perlcritic will choke:

$ perlcritic x.pl
Problem while critiquing "x.pl": Can't parse code: Fatal error... regex failed to match in 'ó => 3 };
' when expected at /usr/share/perl5/PPI/Token/Word.pm line 217.

And when critique comes across such an error, it doesn't recover:

Running Perl::Critic against ([path hidden])
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Can't parse code: Fatal error... regex failed to match in 'ú}->{mappings}}), 2;
' when expected at /usr/share/perl5/PPI/Token/Word.pm line 217.