Subject: | [PATCH] throw an exception if PPI fails to parse code |
Patch is at github already:
https://github.com/rjbs/perl-prereqscanner/pull/1
Patch description copied below:
PPI parses a lot of random character sequences, but sometimes it fails.
Perl::PrereqScanner then throws obscure exceptions:
$ perl -MPerl::PrereqScanner -e
'Perl::PrereqScanner->new->scan_string("\x0");' Can't call method "find"
on an undefined value at
/opt/local/lib/perl5/site_perl/5.8.9/Perl/PrereqScanner/Scanner/Perl5.pm
line 14.
This patch makes Perl::PrereqScanner fail earlier and with more clear
message. It also documents that 'scan_file' and 'scan_string' methods
can throw exceptions.