summaryrefslogtreecommitdiffstats
path: root/perl_checker_fake_packages
diff options
context:
space:
mode:
Diffstat (limited to 'perl_checker_fake_packages')
-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*$/));
}