summaryrefslogtreecommitdiffstats
path: root/fake_packages/gen.pl
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-24 23:43:35 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-24 23:43:35 +0000
commita2a5d22cb85b02e652708f2cbbd98e023ba0af06 (patch)
tree67eac88626427b0befc570c0d3654668df8c2ded /fake_packages/gen.pl
parent03d402ac879a836097a2073c34d4f85abca12ad7 (diff)
downloadperl_checker-a2a5d22cb85b02e652708f2cbbd98e023ba0af06.tar
perl_checker-a2a5d22cb85b02e652708f2cbbd98e023ba0af06.tar.gz
perl_checker-a2a5d22cb85b02e652708f2cbbd98e023ba0af06.tar.bz2
perl_checker-a2a5d22cb85b02e652708f2cbbd98e023ba0af06.tar.xz
perl_checker-a2a5d22cb85b02e652708f2cbbd98e023ba0af06.zip
handle special case "sub foobar { shift->method_call(...) } (eg: Net::FTP)
Diffstat (limited to 'fake_packages/gen.pl')
-rwxr-xr-xfake_packages/gen.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/fake_packages/gen.pl b/fake_packages/gen.pl
index 3fc8a4b..527636b 100755
--- a/fake_packages/gen.pl
+++ b/fake_packages/gen.pl
@@ -3,8 +3,6 @@
use strict;
use MDK::Common;
-# FIXME: handle "sub binary { shift->type('I', @_); }" (Net::FTP)
-
my ($current_package, $current_prefix, $current_name);
sub is_blacklisted {
@@ -22,6 +20,11 @@ sub get_paras {
$current_name = $name;
# perl_checker don't like those:
return if is_blacklisted($name);
+ # handle special case "sub foobar { shift->method_call(...) }
+ if ($para =~ /shift->\S+\(.*\@_\b.*\)/) {
+ $l{$current_package}{$name} = [ '$_self', '@_more_paras' ];
+ return;
+ }
$l{$current_package}{$name} = [ map {
if (/\Q.../) {
# C code:
@@ -132,6 +135,7 @@ sub parse_pm {
$name =~ s/{$//;
$l{$current_package}{$name} = [] if !defined($l{$current_package}{$name}) && !is_blacklisted($name);
$state = 'waiting_for_param';
+ get_paras($name, $_) if /shift->/;
} elsif ($state eq 'waiting_for_param' && /=\s*\@_/) {
get_paras($name, $_);
$state = 'waiting_for_end';