2004/01/16 21:22:27
[org.ibex.core.git] / src / org / xwt / js / Lexer.java
index e0ecde9..af0e8ef 100644 (file)
@@ -80,9 +80,12 @@ class Lexer implements Tokens {
     private int getKeyword(String name) throws IOException {
         //#switch(name)
         case "if": return IF;
+        case "lt": return LT;
+        case "gt": return GT;
         case "in": return IN;
         case "do": return DO;
         case "and": return AND;
+        case "or": return OR;
         case "for": return FOR;
         case "int": return RESERVED;
         case "new": return RESERVED;
@@ -263,7 +266,7 @@ class Lexer implements Tokens {
         case ')': return RP;
         case ',': return COMMA;
         case '?': return HOOK;
-        case ':': return COLON;
+        case ':': return !in.match(':') ? COLON : in.match('=') ? GRAMMAR : le(":: is not a valid token");
         case '.': return DOT;
         case '|': return in.match('|') ? OR : (in.match('=') ? ASSIGN_BITOR : BITOR);
         case '^': return in.match('=') ? ASSIGN_BITXOR : BITXOR;
@@ -293,6 +296,7 @@ class Lexer implements Tokens {
         }
     }
 
+    private int le(String s) throws LexerException { if (true) throw new LexerException(s); return 0; }
 
     // SmartReader ////////////////////////////////////////////////////////////////