This PR adds a graphical representation of the last few lines before and error and highlighting of the error token from underneath, intended to make it easier to understand which part of the print out was cause of the error.
Some examples (using Moo with Nearley):
Before:
Error: Syntax error at line 4 col 1:
^
After:
Error: Syntax error at line 4 col 1:
1
2
3 new of self with iterable:
4
^
Before:
Error: Syntax error at line 6 col 5:
note:
^
After:
Error: Syntax error at line 6 col 5:
2 use software,
3 category
4
5
6 note:`This is the main software`
~
Before:
Error: Syntax error at line 35 col 11:
square of x
^
After:
Error: Syntax error at line 35 col 11:
31 otherwise:
32 result 'stopped'
33
34
35 square of x:
~
Before:
Error: Syntax error at line 11 col 30:
for each number in infinity,
^
After:
Error: Syntax error at line 11 col 30:
7 collect self + 1 + number
8
9
10 numbersLessThan self:
11 for each number in infinity, with extent: self,
\tab ~
This PR adds a graphical representation of the last few lines before and error and highlighting of the error token from underneath, intended to make it easier to understand which part of the print out was cause of the error.
Some examples (using Moo with Nearley):
Before:
After:
Before:
After:
Before:
After:
Before:
After: