Dear Maintainer,
Line numbers refering to the source .l file are generally out by one,
making it difficult to handle compiler error messages (especially when
gcc tries to be helpful by displaying the line, but instead shows the
wrong line) or to debug in gdb as gdb shows the wrong line.
Injecting an error into the code:
^#{s}+{D}+{s}+\"(\.|[^"\n])*\".*$ { li ne_info (yytext + 1); } // line 120
Produces:
../tools/qfcc/source/qc-lex.l:121:3: error: unknown type name ‘li’
121 | ^#line{s}+{D}+{s}+\"(\.|[^"\n])*\".*$ { line_info (yytext + 5); }