Normalise relation modifiers to lower-case.
[cql-java-moved-to-github.git] / src / org / z3950 / zing / cql / CQLParser.java
index a365030..6329146 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: CQLParser.java,v 1.16 2002-11-06 20:13:45 mike Exp $
+// $Id: CQLParser.java,v 1.19 2002-11-08 16:38:47 mike Exp $
 
 package org.z3950.zing.cql;
 import java.io.IOException;
@@ -12,7 +12,7 @@ import java.io.FileNotFoundException;
 /**
  * Compiles CQL strings into parse trees of CQLNode subtypes.
  *
- * @version    $Id: CQLParser.java,v 1.16 2002-11-06 20:13:45 mike Exp $
+ * @version    $Id: CQLParser.java,v 1.19 2002-11-08 16:38:47 mike Exp $
  * @see                <A href="http://zing.z3950.org/cql/index.html"
  *                     >http://zing.z3950.org/cql/index.html</A>
  */
@@ -46,7 +46,8 @@ public class CQLParser {
 
        lexer.nextToken();
        debug("about to parse_query()");
-       CQLNode root = parse_query("srw.serverChoice", new CQLRelation("="));
+       CQLNode root = parse_query("srw.serverChoice", new CQLRelation("scr"));
+       // ### "scr" above should arguably be "="
        if (lexer.ttype != lexer.TT_EOF)
            throw new CQLParseException("junk after end: " + lexer.render());
 
@@ -129,7 +130,7 @@ public class CQLParser {
                    lexer.ttype != lexer.TT_STEM)
                    throw new CQLParseException("expected relation modifier, "
                                                + "got " + lexer.render());
-               relation.addModifier(lexer.sval);
+               relation.addModifier(lexer.sval.toLowerCase());
                match(lexer.ttype);
            }