summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-12-07 17:00:41 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-12-07 17:00:41 +0100
commit9e09742e9b5789a94b7676ff5f4e01468d2f2d88 (patch)
tree0aa972d67e8386a2a612c1c333f3d6d016dba34c
parentd928a6f23979bd0c91a5a192f23911f958c91a09 (diff)
downloadplan9front-9e09742e9b5789a94b7676ff5f4e01468d2f2d88.tar.xz
yacc: attempt to keep line numbers right for yyparse()
as the generated parser intermixes lines from .y source and the parser text, the line source/lineno for yyparse() shows up wrong in the debugger. to make stack traces a bit less crazy, put a #line 1 "/sys/lib/yaccpar" before copying in the parser text.
-rw-r--r--sys/src/cmd/yacc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/src/cmd/yacc.c b/sys/src/cmd/yacc.c
index b25594df9..4b809de9c 100644
--- a/sys/src/cmd/yacc.c
+++ b/sys/src/cmd/yacc.c
@@ -474,6 +474,7 @@ others(void)
Bprint(ftable, "%4d\n};\n", 0);
/* copy parser text */
+ Bprint(ftable, "\n#line\t1\t\"%s\"\n", parser);
while((c=Bgetrune(finput)) != Beof) {
if(c == '$') {
if((c = Bgetrune(finput)) != 'A')