diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-08-28 12:26:33 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-08-28 12:26:33 +0000 |
commit | 43434ac0c52423f634692c258cc13cfa79565569 (patch) | |
tree | c56becb3a998303763c7f563433e26cc4abc0b4d /perl_checker_fake_packages | |
parent | fb1fff6cfea58744f514585f9c1e654f0effe4b8 (diff) | |
download | perl-MDK-Common-43434ac0c52423f634692c258cc13cfa79565569.tar perl-MDK-Common-43434ac0c52423f634692c258cc13cfa79565569.tar.gz perl-MDK-Common-43434ac0c52423f634692c258cc13cfa79565569.tar.bz2 perl-MDK-Common-43434ac0c52423f634692c258cc13cfa79565569.tar.xz perl-MDK-Common-43434ac0c52423f634692c258cc13cfa79565569.zip |
print number of the bad line
Diffstat (limited to 'perl_checker_fake_packages')
-rwxr-xr-x | perl_checker_fake_packages/gen.pl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/perl_checker_fake_packages/gen.pl b/perl_checker_fake_packages/gen.pl index 58148a5..9b2b4f7 100755 --- a/perl_checker_fake_packages/gen.pl +++ b/perl_checker_fake_packages/gen.pl @@ -27,7 +27,9 @@ sub parse_xs { my $state = 'waiting_for_type'; ($current_package, $current_prefix) = ('', ''); my $multi_line; + my $c; foreach (cat_($file)) { + $c++; chomp; my $orig_line = $_; @@ -58,7 +60,7 @@ sub parse_xs { my $pkg = $f =~ s/(.*)::// ? $1 : $current_package; $l{$pkg}{$f} ||= $l{$current_package}{$current_name}; } else { - warn "bad line $orig_line (state: $state)\n" if !/^\s*\w+:\s*$/ && !/^\s*$/; + warn "bad line #$c $orig_line (state: $state)\n" if !/^\s*\w+:\s*$/ && !/^\s*$/; $state = 'waiting_for_end'; } } elsif ($state eq 'waiting_for_type' && s/^(const\s*)?\w+\s*(\*\s*)?// || @@ -71,10 +73,10 @@ sub parse_xs { $current_name = $name; $state = 'multi_line'; } else { - warn "bad line $orig_line (state: $state)\n"; + warn "bad line #$c $orig_line (state: $state)\n"; } } else { - warn "bad line $orig_line (state: $state)\n" if + warn "bad line #$c $orig_line (state: $state)\n" if !(($state eq 'waiting_for_end' || $state eq 'waiting_for_type') && (/^\s/ || /^[{}]\s*$/ || /^(CODE|OUTPUT):\s*$/)); } |