[Zope-CVS] CVS: Products/ZCTextIndex - QueryParser.py:1.1.2.5
Guido van Rossum
guido@python.org
Wed, 1 May 2002 10:03:12 -0400
Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv13597
Modified Files:
Tag: TextIndexDS9-branch
QueryParser.py
Log Message:
Cripple the parser to only accept NOT after AND.
=== Products/ZCTextIndex/QueryParser.py 1.1.2.4 => 1.1.2.5 ===
Start = OrExpr
OrExpr = AndExpr ('OR' AndExpr)*
-AndExpr = NotExpr ('AND' NotExpr)*
+AndExpr = Term ('AND' NotExpr)*
NotExpr = ['NOT'] Term
Term = '(' OrExpr ')' | ATOM
@@ -80,7 +80,7 @@
def _parseAndExpr(self):
L = []
- L.append(self._parseNotExpr())
+ L.append(self._parseTerm())
while self._check("AND"):
L.append(self._parseNotExpr())
if len(L) == 1: