mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
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:
parent
d928a6f239
commit
9e09742e9b
1 changed files with 1 additions and 0 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue