diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-12-07 17:00:41 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-12-07 17:00:41 +0100 |
commit | 9e09742e9b5789a94b7676ff5f4e01468d2f2d88 (patch) | |
tree | 0aa972d67e8386a2a612c1c333f3d6d016dba34c | |
parent | d928a6f23979bd0c91a5a192f23911f958c91a09 (diff) | |
download | plan9front-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.c | 1 |
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') |