|
|
|
|
|
# Context around error messages
|
|
|
|
|
|
It would be helpfull to print the surrounding code when an error occurs.
|
|
|
This would make it easier to understand the error message.
|
|
|
|
|
|
Like the error could be: "No instance of function `foo` found in the scope."
|
|
|
|
|
|
But we format it something like this:
|
|
|
|
|
|
```
|
|
|
|
|
|
Not Found Error
|
|
|
Simple.sac:5:4
|
|
|
|
|
|
int main() {
|
|
|
foo();
|
|
|
}
|
|
|
^^^
|
|
|
```
|
|
|
|
|
|
We could try to print the line before and the line afterwards as well.
|
|
|
|
|
|
We could probably just print the one line where it is and do ^^^ below until before the ;
|
|
|
|
|
|
Look at other programming languages how they print their source in errors.
|
|
|
Which ones are the nicest? |
|
|
\ No newline at end of file |