Closed inikolaev closed 1 year ago
Thank you for uncovering this issue! It looks like operator precedence is incorrect, where precedence should be given to ==
when it is instead given to the &&
. I'll need to review our parser and see what I can find. As a side note, I checked the spec and Go implementation and they behave in the same way as your Python implementation confirming the bug in this Rust implementation.
Edit: Okay, I think I've got a fix that resolves the issue and passes all the existing tests. I'll implement additional tests and final cleanup tomorrow.
I've been playing around with this CEL implementation and I noticed one odd thing with the following expressions:
Given this context
they should all evaluate to
true
, but this is not what's happening:Here's a simple reproducer:
It produces the following output:
It seems like in the case of
b && c == "string"
the interpreter effectively evaluates this expressionI'm also using a Python version of CEL interpreter and it evaluates it properly:
Produces