Skip to content

Commit

Permalink
Issue #20: Add support for boolean NOT clause.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiz committed Sep 22, 2016
1 parent c461b45 commit aeb144b
Show file tree
Hide file tree
Showing 2 changed files with 237 additions and 161 deletions.
8 changes: 8 additions & 0 deletions esquery/grammar.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ QueryAND
}

QueryNOT
= a:QueryUnaryNOT b:(_ 'NOT' _ QueryUnaryNOT)? {
if(isset($b) && count($b)) {
return [Token::F_AND, [$a, [Token::F_NOT, $b[3]]]];
}
return $a;
}

QueryUnaryNOT
= neg:'-'? '(' _? expr:QueryExpression _? ')' {
if($neg) {
return [Token::F_NOT, $expr];
Expand Down
Loading

0 comments on commit aeb144b

Please sign in to comment.