Merge "Support '-' as negation operator in query"
This commit is contained in:
commit
fdff70841e
@ -64,7 +64,7 @@ tokens = [
|
|||||||
def SearchTokenizer():
|
def SearchTokenizer():
|
||||||
t_LPAREN = r'\(' # NOQA
|
t_LPAREN = r'\(' # NOQA
|
||||||
t_RPAREN = 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)
|
t_ignore = ' \t' # NOQA (and intentionally not using r'' due to tab char)
|
||||||
|
|
||||||
def t_OP(t):
|
def t_OP(t):
|
||||||
@ -109,7 +109,7 @@ def SearchTokenizer():
|
|||||||
return t
|
return t
|
||||||
|
|
||||||
def t_USTRING(t):
|
def t_USTRING(t):
|
||||||
r'([^\s\(\)!]+)'
|
r'([^\s\(\)!-][^\s\(\)!]*)'
|
||||||
t.value=t.value.decode("string-escape")
|
t.value=t.value.decode("string-escape")
|
||||||
return t
|
return t
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user