$current = \$junk;
while (<TYPEMAP>) {
next if /^\s*#/;
+ my $line_no = $. + 1;
if (/^INPUT\s*$/) { $mode = 'Input'; $current = \$junk; next; }
if (/^OUTPUT\s*$/) { $mode = 'Output'; $current = \$junk; next; }
if (/^TYPEMAP\s*$/) { $mode = 'Typemap'; $current = \$junk; next; }
sub print_section {
+ my $count = 0;
$_ = shift(@line) while !/\S/ && @line;
for (; defined($_) && !/^$BLOCK_re/o; $_ = shift(@line)) {
+ print line_directive() unless ($count++);
print "$_\n";
}
}
&{"${kwd}_handler"}()
while $kwd = check_keyword($pattern) ;
+ print line_directive();
}
sub CASE_handler {
unless defined($args_match{$outarg});
blurt("Error: No input definition for OUTPUT argument '$outarg' - ignored"), next
unless defined $var_types{$outarg} ;
+ print line_directive();
if ($outcode) {
print "\t$outcode\n";
} else {
*/
EOM
-
+print "#line 1 \"$filename\"\n";
while (<$FH>) {
last if ($Module, $Package, $Prefix) =
$lastline = $_;
$lastline_no = $.;
-
# Read next xsub into @line from ($lastline, <$FH>).
sub fetch_para {
# parse paragraph
if (check_keyword("BOOT")) {
&check_cpp;
- push (@BootCode, $_, @line, "") ;
+ push (@BootCode, $_, line_directive(), @line, "") ;
next PARAGRAPH ;
}
} elsif ($gotRETVAL || $wantRETVAL) {
&generate_output($ret_type, 0, 'RETVAL');
}
+ print line_directive();
# do cleanup
process_keyword("CLEANUP|ALIAS|PROTOTYPE") ;
eval qq/print " $init\\\n"/;
}
+sub line_directive
+{
+ # work out the line number
+ my $line_no = $line_no[@line_no - @line -1] ;
+
+ return "#line $line_no \"$filename\"\n" ;
+
+}
+
sub Warn
{
# work out the line number