Open martin-henz opened 2 months ago
I think I will first make sure all errors include location, then look at including the offending character/characters in errors since the error message that I am returning already has a pointer to the general location.
An example here:
At the same time, source academy frontend has a SourceError
type that defaults to printing the start and end of the offending part of the program in some kind of format, I am thinking of supporting SourceError
as well ontop of the above error message.
I am thinking of supporting SourceError as well ontop of the above error message.
Just to tap on, ECE attempted to support SourceError
already, although still missing location info, can check it out here. Perhaps it's a good idea in the long run to share these errors among all components of java-slang, e.g., type checker, compiler, JVM, ECE, as I believe these errors are indifferent to the different components and this improves output consistency as well.
Example:
javac gives:
Source Academy gives:
A few improvements possible:
Type error:
instead of justError: