diff options
Diffstat (limited to 'fake_packages')
-rwxr-xr-x | fake_packages/gen.pl | 8 |
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'; |