fusesoc
fusesoc copied to clipboard
CAPI2 parsing: Always include file and line of parsed file in errors
Currently capi2/core.py
throws many SyntaxError
s without indicating the exact source location this error comes from. You can guess the file typically by enabling more verbose logging, but that's non-ideal nonetheless.
We should improve the SyntaxError
calls by setting at least the filename, and where possible the source line, and report this as part of the error message. It looks like there are appropriate attributes on this exception class which we can use, otherwise we need to extend the class with a fusesoc specific one.
I agree and I have tried to improve this a couple of times. IIRC there are some that are a bit more tricky since they don't have the context of which core they operate on but I can't recall the details now. In any case, improved error messages are very welcome