Once again, one recompilation it is fine, two it stops working, wtf?
Return errors in the JSON.
Allow the parsers to return multiple errors and handle them.
Generalize the parsing in the structured parser.

The PEG parser is now trivial and the error handling is done in
query.OpEnd() and much more clear to the user.