mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Searching: Fix A (B) not being treated as A AND (B)
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
64c375848b
@ -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
|
||||
|
||||
|
@ -322,6 +322,7 @@ class Tester(SearchQueryParser):
|
||||
'author:S\\"calzi': {343},
|
||||
'"S\\"calzi"': {343},
|
||||
'M\\\\cMurtry': {427},
|
||||
'author:Tolstoy (tag:txt OR tag:pdf)': set([55, 56]),
|
||||
}
|
||||
fields = {'title':0, 'author':1, 'publisher':2, 'tag':3}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user