Browse Source

Support '-' as negation operator in query

This nudges slightly toward harmony with the Gerrit web UI
search syntax.

Change-Id: Ibff2bef27d2e5d3f3d703c877d9332d5aa670c54
changes/91/391991/1
Clint Adams 6 years ago
parent
commit
e042b4e679
  1. 4
      gertty/search/tokenizer.py

4
gertty/search/tokenizer.py

@ -64,7 +64,7 @@ tokens = [
def SearchTokenizer():
t_LPAREN = r'\(' # NOQA
t_RPAREN = r'\)' # NOQA
t_NEG = r'!' # NOQA
t_NEG = r'[-!]' # NOQA
t_ignore = ' \t' # NOQA (and intentionally not using r'' due to tab char)
def t_OP(t):
@ -109,7 +109,7 @@ def SearchTokenizer():
return t
def t_USTRING(t):
r'([^\s\(\)!]+)'
r'([^\s\(\)!-][^\s\(\)!]*)'
t.value=t.value.decode("string-escape")
return t

Loading…
Cancel
Save