-
Notifications
You must be signed in to change notification settings - Fork 71
How to handle complex or and ands #18
Comments
So far it seems this parser is not capable of having (a and b) or (c and d). Since this is not a farfetched use case, it would be great to have this feature! |
@Hakaze agreed |
It needs to handle operator precedence properly. |
👍 |
@ishwor-mis can you provide any insight on this issue? |
What I have found is that if you want to do something like:
You must help this parser out by using grouping operators So I would change the aforementioned filter to:
The resulting AST will be much different ( |
The PEG grammar used still doesn't handle operator precedence correctly. But now that #23 is merged, there is a simple workaround - just use parenthesis in your $filter clause. |
You mean like I did above? That's worked for some time now |
Is it possible to handle a case where we need to handle complex or and and filters as the filter below?
$filter=Name eq 'John' and LastName eq 'Doe' or MiddleName eq 'mdle' and emailAddress eq '[email protected]'
Here I am trying to do the following
select * from sometable where Name='John' and (LastName='Doe' or MiddleName='mdle') and emailAddress='[email protected]'
The text was updated successfully, but these errors were encountered: