From 9e09742e9b5789a94b7676ff5f4e01468d2f2d88 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 7 Dec 2015 17:00:41 +0100 Subject: 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. --- sys/src/cmd/yacc.c | 1 + 1 file changed, 1 insertion(+) 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') -- cgit v1.2.3