summaryrefslogtreecommitdiffstats
path: root/perl_checker_fake_packages
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-04-28 15:22:17 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-04-28 15:22:17 +0000
commit98512d7845937c3a600e24ef4cc3cb65dd52cb59 (patch)
treed638d3f13f5185231d9694c2f6e9209344bc55a5 /perl_checker_fake_packages
parente410bdf9bc71ddc2e3351d81dcfdf0d892660fa9 (diff)
downloadperl-MDK-Common-98512d7845937c3a600e24ef4cc3cb65dd52cb59.tar
perl-MDK-Common-98512d7845937c3a600e24ef4cc3cb65dd52cb59.tar.gz
perl-MDK-Common-98512d7845937c3a600e24ef4cc3cb65dd52cb59.tar.bz2
perl-MDK-Common-98512d7845937c3a600e24ef4cc3cb65dd52cb59.tar.xz
perl-MDK-Common-98512d7845937c3a600e24ef4cc3cb65dd52cb59.zip
add traditional forms of subroutines declarations in .pm files
Diffstat (limited to 'perl_checker_fake_packages')
-rwxr-xr-xperl_checker_fake_packages/gen.pl12
1 files changed, 11 insertions, 1 deletions
diff --git a/perl_checker_fake_packages/gen.pl b/perl_checker_fake_packages/gen.pl
index c209be0..4d18665 100755
--- a/perl_checker_fake_packages/gen.pl
+++ b/perl_checker_fake_packages/gen.pl
@@ -24,11 +24,22 @@ sub gtk2 {
#- explore first line of subroutine definition
local $_ = $contents[$::i+1];
+ /^\s*{\s*$/ and $_ = $contents[$::i+2];
+
+ #- traditional form
+ #- my ($class, $interval, $func, $data) = @_;
+ if (/^\s*my\s*\(([^\)]+)\)\s*=\s*\@_\s*;\s*$/) {
+ my @args = map { /^\s*\$(.*)/ or goto skip_trad; '$_'.$1 } split /,/, $1;
+ $add->($fun, ' { my ('.join(', ', @args).') = @_ }');
+ skip_trad:
+ }
+
#- methods with no argument
#- my $values = shift->_get_size_request;
if (/shift->\w+\s*;/) {
$add->($fun, ' { my ($_self) = @_ }');
}
+
#- methods with variable list of arguments (which branch to different XS functions)
#- Gtk2::_Helpers::check_usage(\@_, [ 'Gtk2::GSList group' ], [ 'Gtk2::GSList group', 'string label' ]);
if (/Gtk2::_Helpers::check_usage\(\\\@_, (.*)\);/) {
@@ -102,7 +113,6 @@ sub gtk2 {
/\.c$/ and $c_file->($_);
}
-
print
"package Gtk2;