[Zope-Checkins] CVS: Products/PluginIndexes/TextIndex - TextIndex.py:1.14

Evan Simpson evan@zope.com
Wed, 15 Aug 2001 16:54:58 -0400


Update of /cvs-repository/Products/PluginIndexes/TextIndex
In directory cvs.zope.org:/tmp/cvs-serv14127/TextIndex

Modified Files:
	TextIndex.py 
Log Message:
Merge bugfix from Zope-2_4-branch


=== Products/PluginIndexes/TextIndex/TextIndex.py 1.13 => 1.14 ===
         
 
+        
+
         self._lexicon = None
 
         if lexicon is not None:
@@ -700,7 +702,6 @@
             else: i = i + 1
 
         if (len(query) != 1):
-            import pdb; pdb.set_trace()
             raise QueryError, "Malformed query"
 
         return query[0]
@@ -748,13 +749,14 @@
 def parse2(q, default_operator, operator_dict=operator_dict):
     """Find operators and operands"""
     isop = operator_dict.has_key
-    i = len(q) - 1
-    while i >= 0:
+    i = 0
+    while i < len(q):
         e = q[i]
         if isinstance(e, ListType):
             q[i] = parse2(e, default_operator)
             if i % 2:
                 q.insert(i, default_operator)
+                i = i + 1
         elif i % 2:
             # This element should be an operator
             if isop(e):
@@ -763,7 +765,8 @@
             else:
                 # Insert the default operator.
                 q.insert(i, default_operator)
-        i = i - 1
+                i = i + 1
+        i = i + 1
 
     return q