summaryrefslogtreecommitdiffstats
path: root/perl_checker_fake_packages/gen.pl
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-08-28 12:26:33 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-08-28 12:26:33 +0000
commit888a25c34139626272750a15b604b109c0cfef0c (patch)
treec80481a71e3b8306a47fc1db6133bb83f30a7fa5 /perl_checker_fake_packages/gen.pl
parent61687eb8ba0d6850e0ef5693cc1ae21dc28857ca (diff)
downloadperl_checker-888a25c34139626272750a15b604b109c0cfef0c.tar
perl_checker-888a25c34139626272750a15b604b109c0cfef0c.tar.gz
perl_checker-888a25c34139626272750a15b604b109c0cfef0c.tar.bz2
perl_checker-888a25c34139626272750a15b604b109c0cfef0c.tar.xz
perl_checker-888a25c34139626272750a15b604b109c0cfef0c.zip
print number of the bad line
Diffstat (limited to 'perl_checker_fake_packages/gen.pl')
-rwxr-xr-xperl_checker_fake_packages/gen.pl8
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*$/));
}