For the CQL parser, make boolean node names lowercase.
[yaz-moved-to-github.git] / src / cql.y
index b5077d3..d01405d 100644 (file)
--- a/src/cql.y
+++ b/src/cql.y
@@ -1,6 +1,6 @@
-/* $Id: cql.y,v 1.9 2005-06-27 22:03:59 adam Exp $
-   Copyright (C) 2002-2004
-   Index Data Aps
+/* $Id: cql.y,v 1.12 2006-12-14 08:55:52 adam Exp $
+   Copyright (C) 2002-2006
+   Index Data ApS
 
 This file is part of the YAZ toolkit.
 
@@ -135,7 +135,10 @@ searchClause:
 /* unary NOT search TERM here .. */
 
 boolean: 
-  AND | OR | NOT | PROX 
+  AND { $$.buf = "and"; } 
+| OR { $$.buf = "or"; } 
+| NOT { $$.buf = "not"; } 
+| PROX { $$.buf = "prox"; } 
   ;
 
 modifiers: modifiers '/' searchTerm
@@ -286,13 +289,12 @@ int yylex(YYSTYPE *lval, void *vp)
     }
     else
     {
-        putb(lval, cp, c);
-        while ((c = cp->getbyte(cp->client_data)) != 0 &&
-               !strchr(" \n()=<>/", c))
+        while (c != 0 && !strchr(" \n()=<>/", c))
         {
             if (c == '\\')
                 c = cp->getbyte(cp->client_data);
             putb(lval, cp, c);
+           c = cp->getbyte(cp->client_data);
         }
 #if YYDEBUG
         printf ("got %s\n", lval->buf);