seax
seax copied to clipboard
Improve Scheme compiler error messages
It would be really nice if the compile error messages carried over source position information.
This would require modifications to the AST to allow AST nodes to be annotated with position information from the parser. This wouldn't be particularly difficult, but it would take some work, so I'm moving this to the Scheme v2.0 milestone as I'd rather focus on higher-priority issues (i.e. #15 and #14 ).
Also, carrying this extra data around might make the compiler slightly slower. In scenarios where a binary is being compiled, this isn't a significant problem, but if the Scheme compiler is running as a line-by-line interpreter, every nanosecond counts. Therefore, it would be nice if this could be done conditionally.
I made a dev branch for this and started messing with it. Not sure when I'll actually get around to finishing it.
Other compiler error message improvements:
- consider making the
CompileResulttype's error component carry a list of error messages rather than a single one. - give AST nodes the ability to reconstruct the lines of source code they were built from (since Lisp code is Basically Just Its' Own AST anyway)