tenderlove/racc — pull request #31 by JasonBarnabe (2013-08-26 23:06:36+00:00)
Title: Include context in error message

Currently racc will output something like this on a syntax error:

>parse error on value ";" (SEMI)

which is not very useful if you've got semi-colons on every line of a 100KB file. Since line number and column number are apparently not possible (#15), the next best thing would be to include the context around the error.

With this change, we will now say this:

>parse error on value ";" (SEMI) around "blah.blah.;blah.blah."

(the 10 characters preceding the token, the token, then the 10 characters after the token.)