Support '-' as negation operator in query
This nudges slightly toward harmony with the Gerrit web UI search syntax. Change-Id: Ibff2bef27d2e5d3f3d703c877d9332d5aa670c54
This commit is contained in:
parent
0b02fafdc7
commit
e042b4e679
|
@ -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…
Reference in New Issue