summaryrefslogtreecommitdiff
path: root/perlyline.pl
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-06-14 08:25:07 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-06-14 08:25:07 +0000
commit2e5d22836112bd11875eead20069e6c8ae18474c (patch)
treefdaa9a05f9cc98d05bb9049d7772de6ea8216b68 /perlyline.pl
parent9435c942a8d9cbcb31530975b43f7a03ffcf591c (diff)
downloadperl-2e5d22836112bd11875eead20069e6c8ae18474c.tar.gz
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
Diffstat (limited to 'perlyline.pl')
-rw-r--r--perlyline.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/perlyline.pl b/perlyline.pl
new file mode 100644
index 0000000000..f360fb41ef
--- /dev/null
+++ b/perlyline.pl
@@ -0,0 +1,11 @@
+$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;
+ }