Closed tohanss closed 4 years ago
Yep, we definitely wanna say which file causes the error. Ideally, we should check all files before starting to sanitize, and report errors for all files at the same time. Perhaps check_syntax
should return a list of errors, as opposed to raising an error. I'd imagine something like this:
Syntax errors detected in 2 file(s):
some/bad/file.txt
Line 36: Missing prefix
Line 57: Missing prefix
some/other/file.txt
Line 2: Some other error message
When you design this, take inspiration from any compiler. For example, run the java compiler on a couple of obviously bad files and see what it says.
Instead of giving this:
We probably want it to tell us what file caused this as well, (they are all the same file, since sanitizer reports errors on a file to file basis)