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.
This commit is contained in:
cinap_lenrek 2015-12-07 17:00:41 +01:00
parent d928a6f239
commit 9e09742e9b

View file

@ -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')