ref: 68d9155e1fff6c4c2d69c96f3fd4e7dc66cdeebd
parent: e4b8e72fd1f22a016045f257501616ad99fd4861
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Dec 7 12:00:41 EST 2015
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.
--- a/sys/src/cmd/yacc.c
+++ b/sys/src/cmd/yacc.c
@@ -474,6 +474,7 @@
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')
--
⑨