Search: adjust association of negation

Make negation left-associative, so that it groups from the left.
This seems to match what Gerrit does.  This means that:

  not owner:self project:foo

is:

  (not owner:self) and (project:foo)

rather than the previous, erroneous behavior:

  not (owner:self and project:foo)

Change-Id: I9a922fb16d0b0e0c3d17871dc0e74f2211e36399
This commit is contained in:
James E. Blair 2015-01-12 12:04:34 +13:00
parent 52176fe785
commit afb01dc07b
1 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,10 @@ import gertty.search
from tokenizer import tokens
def SearchParser():
precedence = (
('left', 'NOT', 'NEG'),
)
def p_terms(p):
'''expression : list_expr
| paren_expr