When there is a type checking or evaluation error, it would be desirable that the terminal shows the surrounding source code, and notes indicating what went wrong (see the rust compiler for an example).
To implement this:
[ ] Sugar AST/Parser needs to separate from Core.
[ ] Sugar nodes need to contain the source location (begin and end).
[ ] Core AST nodes should have a source (that should be pointing at either Sugar nodes, or their original location).
[ ] In case of an error, that should be caught at the sugar processor, and the error should be printed in the context of the sugar program.
When there is a type checking or evaluation error, it would be desirable that the terminal shows the surrounding source code, and notes indicating what went wrong (see the rust compiler for an example).
To implement this: