[Zope-CVS] CVS: Products/ZCTextIndex - QueryParser.py:1.1.2.13

Tim Peters tim.one@comcast.net
Tue, 7 May 2002 15:23:08 -0400


Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv1327

Modified Files:
      Tag: TextIndexDS9-branch
	QueryParser.py 
Log Message:
parseQuery():  Simplify token classification.


=== Products/ZCTextIndex/QueryParser.py 1.1.2.12 => 1.1.2.13 ===
         self.__tokens = tokens
         # classify tokens
-        self.__tokentypes = [_EOF] * len(tokens)
-        for i in range(len(tokens)):
-            token = tokens[i].upper()
-            self.__tokentypes[i] = _keywords.get(token, _ATOM)
+        self.__tokentypes = [_keywords.get(token.upper(), _ATOM)
+                             for token in tokens]
         # add _EOF
         self.__tokens.append(_EOF)
         self.__tokentypes.append(_EOF)