Search parsing: fix using a parenthesized expression following an implied "and".

This commit is contained in:
Charles Haley 2018-04-29 11:00:37 +02:00
parent 2723d9f2cf
commit c6a6fe07cf

View File

@ -221,8 +221,8 @@ class Parser(object):
return ['and', lhs, self.and_expression()]
# Account for the optional 'and'
if (self.token_type() in [self.WORD, self.QUOTED_WORD] and
self.lcase_token() != 'or'):
if ((self.token_type() in [self.WORD, self.QUOTED_WORD] or self.token() == '(')
and self.lcase_token() != 'or'):
return ['and', lhs, self.and_expression()]
return lhs