Problem: I cannot do complex OR clauses as I cannot use AND inside OR #566
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
within search OR operation only allow one search key while the protocol allow multiple.
To solve this I added special operator called AND which is allow only within OR clause, the AND just allow unbound array which is inline into the OR operation.
Some examples, if I want to the following IMAP query I cannot do that before this PR:
OR (UNKEWORD DISCARD) (BEFORE 24-AUG-2016 UNSEEN)
trying to do the following yield error:
[['OR', [['UNKEYWORD', 'DISCARD'], [['BEFORE', '24-AUG-2016'], UNSEEN]]]
Now I can do:
[['OR', [['UNKEYWORD', 'DISCARD'], [['AND', ['BEFORE', '24-AUG-2016'], UNSEEN]]]]
which works
If you have another solution for the problem that will be great.