perl/perlyline.pl
Nick Ing-Simmons f4db54055c Add new step to run_byacc which:
A. Corrects #line NNN "perly.c" lines so warnings etc. are trackable
 B. Adds extra () to the two if (var = ...) constructs gcc -Wall winges about.

p4raw-id: //depot/perlio@10586
2001-06-14 08:25:07 +00:00

12 lines
331 B
Perl

$line = 1;
while (<>)
{
$line++;
# 1st correct #line directives for perly.c itself
s/^(#line\s+)\d+(\s*"perly\.c"\s*)$/$1$line$2/;
# now add () round things gcc dislikes
s/if \(yyn = yydefred\[yystate\]\)/if ((yyn = yydefred[yystate]))/;
s/if \(yys = getenv\("YYDEBUG"\)\)/if ((yys = getenv("YYDEBUG")))/;
print;
}