Report column numbers and source text in error messages
Re: Wilson's suggestion in issue #1305, we should report column numbers and source text in error messages like gcc does:
%Error: project/fc/fx.v:1234:23: Illegal bit or array select; type does not have a bit range, or bad dimension: type is real source_error_line = realvar[bad_select]; ^~~~ %Error: : In instance top.fc.roc.foowrap.foo.ctl.csr.shim
#1 Updated by Wilson Snyder 2 months ago
- Category set to Lint
- Status changed from New to Feature
Are you interested in making the column/source printing change? Here's some notes.
I'd think two separate patch sets, one for source printing and one for columns, probably source printing first unless only one interests you.
For source printing FileLineSingleton tracks language and filename for each file letter, probably refactor that into each letter tracking a class and have the filename/language/lines as an array in that class. Then add appropriate accessors. We'd save the results out of the preprocessed code.
Might need some cleanup needed in the preprocessor and elsewhere to preserve columns where it can (i.e. amount of whitespace).
For columns this describes getting columns out of flex: https://stackoverflow.com/questions/656703/how-does-flex-support-bison-location-exactly
we'd then spit the lex'ed columns into the FileLine and rest is easyish.
Also available in: Atom