Closed tjvr closed 7 years ago
Confusing if you have a syntax error at the end of a line, since it would say the line was blank.
(is this useful?)
Yes, because I like to generate error messages that look like this:
Error: invalid syntax at /some/file.ext:12:3
totally valid `syntax`
^
Probably makes sense to include offset
too.
Yes, because I like to generate error messages that look like this
Right. But you could already do that by defining an error rule.
Fair enough. Probably not, then.
Please add line
and col
anyway?
@nanalan Why? As explained above, you can define an error token.
Actually, that's a good point 😜 Error tokens do look like the way to go!
Confusing if you have a syntax error at the end of a line, since it would say the line was blank.
What do you propose? Special-case that -- Invalid end of line
?
I'd be inclined to say just extract the whole line, scanning backward if possible.
@nathan Done!
(Ignore the failed check—that should be fixed now.)
Also, attach
line
andcol
to theError
we throw—(is this useful?)