Skip to content

Wrong error reporting for not syntactic predicate #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ptal opened this issue Jul 31, 2016 · 1 comment
Open

Wrong error reporting for not syntactic predicate #89

ptal opened this issue Jul 31, 2016 · 1 comment

Comments

@ptal
Copy link
Owner

ptal commented Jul 31, 2016

For example take the grammar

predicate = (!"b" .)+ 

with the input b, it will output the wrong message:

unexpected `b`, expecting .

Other example could be find as well, this is because when logging errors we do not know we under in a not predicate.

@ptal
Copy link
Owner Author

ptal commented Aug 1, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant