-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
rego_parse_error with unexpected / confusing message and location #4672
Labels
Comments
I'd be interested in working on this issue and a few others like it once I clear out more of my work backlog. Better error reporting is always useful! |
I'm adding a close-to-minimal test case to this thread that exercises the same confusing behavior: package test
p {
x := 5
y := contains("a"), "b")
} Error message:
EDIT: This case can actually be reduced further: p {
y := contains("a"), "b")
} |
This was referenced Jun 10, 2022
philipaconrad
added a commit
to philipaconrad/opa
that referenced
this issue
Jun 14, 2022
This parser change allows the parser to properly fall through to the RHS case where it was not doing so before, due to returning early during MHS parsing in the parseTermIn() function. Fixes open-policy-agent#4672. Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
srenatus
pushed a commit
that referenced
this issue
Jun 14, 2022
This parser change allows the parser to properly fall through to the RHS case where it was not doing so before, due to returning early during MHS parsing in the parseTermIn() function. Fixes #4672. Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you can spot the error in the below function — good eyes! In fact, even the Rego parser fails to identify the location here, which is the call to
time.diff
and the incorrect parens used on the next last line.The error message reported from this however is:
Full playground example here: https://play.openpolicyagent.org/p/IeLICFb2TD
The text was updated successfully, but these errors were encountered: