Open ptal opened 8 years ago
This is described more in depth in:
Maidl, André Murbach, Sérgio Medeiros, Fabio Mascarenhas, and Roberto Ierusalimschy. “Error Reporting in Parsing Expression Grammars.” arXiv Preprint arXiv:1405.6646, 2014. http://arxiv.org/abs/1405.6646.
The strategy is quite simple, just ignore errors inside !p
, and blame any failure on !p
itself. From the example above we could obtain
unexpected `b`, expecting `!"b"`.
in a first time even if it could be improved later.
For example take the grammar
with the input
b
, it will output the wrong message:Other example could be find as well, this is because when logging errors we do not know we under in a not predicate.