slavapestov/factor — pull request #1165 by bjourne (2014-10-21 14:38:28+00:00)
Title: peg: add 'got' slot to parse-error, so you get a little more info about ...

Here is a small patch to make the peg vocabs error reporting a little more polished. Previously:

"oh im not a request" parse-request-line
Peg parsing error at character position 0.
Expected token 'OPTIONS' or token 'GET' or token 'HEAD' or token 'POST' or token 'PUT' or token 'DELETE' or token 'TRACE' or token 'CONNECT'

Now:

"oh im not a request" parse-request-line
Peg parsing error at character position 0.
Expected 'OPTIONS' or 'GET' or 'HEAD' or 'POST' or 'PUT' or 'DELETE' or 'TRACE' or 'CONNECT'
Got 'oh im not a request'

So when the error is thrown, now it is easier to debug its cause.