-
Notifications
You must be signed in to change notification settings - Fork 80
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
When parsing a StaticPolicySet
from a text representation, only the first error gets recorded.
#1293
Comments
Hi, thanks for the question. Our parse error messages include a Let me know if this doesn't work |
Indeed,
However, this breaks down if I modify the example slightly:
Now I only get the top-level error and no related errors:
Is this an issue with parsing and error reporting or am I not using the parsing interface correctly? |
It looks like you're using it correctly. Now you're running into a known limitation in how our parser handles error recovery. When there's a parse error in that position, it skips ahead to the start of the next policy, ignoring any other parse error which may exist in the current policy. For the other errors it is able to recover and continue parsing within the same policy. This could be improved, but likely won't be a priority for us to get to. If you were interested in hacking on our parsers and contributing an improvement yourself, the place to start would be the relevant production in our grammar and the lalrpop documentation for error recovery. You might also run into the related issue #1054 where a single parsing error will prevent us from reporting any higher level errors. |
Before opening, please confirm:
Bug Category
Cedar Parser
Describe the bug
When parsing a
StaticPolicySet
from a text representation, only the first error gets recorded. This makes handling the parsing results difficult. The use case at hand is the integration with a code editor - in general you want to handle/hint on all parsing errors for a given policy set.Expected behavior
All errors in a provided text representation of a ``StaticPolicySet` should be returned to allow processing of the errors, e.g. displaying errors in a code editor.
Reproduction steps
Call
check_parse_policy_set
on the text representation of a policy set containing more than one error.Code Snippet
Log output
Additional configuration
No response
Operating System
Linux
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: