Closed Jozott00 closed 1 year ago
Sure, the highlighter crashes but the lexer should never create a token that starts with col < 1.
I don't think we should even prevent the highlighter from crashing here, the assumption it makes is compleatly reasonable. The line starts at column 1 so subtracting one should be fine and never result in a negative number.
I will look into why the parser generates anything at col <= 0.
So I printed the tokens and it seams that newlines are getting column = 0.
Fixed, yeah newlines are tricky to handle in the lexer, so previous-me left it as an exercise for current-me (even with a comment describing the exact problem)
Example
Note: The line number is important!
The second does not crash with this error!
Description
This error occures inside of the
Highlighter
in line 14:with the error description: