lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r660674 - in /lucene/java/trunk: ./ src/java/org/apache/lucene/queryParser/ src/test/org/apache/lucene/queryParser/
Date Tue, 27 May 2008 19:55:41 GMT
Author: buschmi
Date: Tue May 27 12:55:36 2008
New Revision: 660674

URL: http://svn.apache.org/viewvc?rev=660674&view=rev
Log:
LUCENE-1189: Fixed the QueryParser to handle escaped characters within quoted terms correctly.


Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserConstants.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java
    lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=660674&r1=660673&r2=660674&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Tue May 27 12:55:36 2008
@@ -108,6 +108,9 @@
 
 10. LUCENE-1046: Removed dead code in SpellChecker
     (Daniel Naber via Otis Gospodnetic)
+	
+11. LUCENE-1189: Fixed the QueryParser to handle escaped characters within 
+    quoted terms correctly. (Tomer Gabel via Michael Busch)
 
 New features
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java?rev=660674&r1=660673&r2=660674&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java Tue May 27 12:55:36
2008
@@ -1337,10 +1337,10 @@
       jj_la1_1();
    }
    private static void jj_la1_0() {
-      jj_la1_0 = new int[] {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,0x80000000,0x20000000,0x80000000,0x10000,0x80000,0x10000,0x1f68000,};
+      jj_la1_0 = new int[] {0x300,0x300,0x1c00,0x1c00,0x3ed3f00,0x90000,0x20000,0x3ed2000,0x2690000,0x100000,0x100000,0x20000,0x30000000,0x4000000,0x30000000,0x20000,0x0,0x40000000,0x0,0x20000,0x100000,0x20000,0x3ed0000,};
    }
    private static void jj_la1_1() {
-      jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0,};
+      jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0x3,0x0,0x0,0x0,0x0,};
    }
   final private JJCalls[] jj_2_rtns = new JJCalls[1];
   private boolean jj_rescan = false;
@@ -1489,10 +1489,7 @@
 
   public ParseException generateParseException() {
     jj_expentries.removeAllElements();
-    boolean[] la1tokens = new boolean[33];
-    for (int i = 0; i < 33; i++) {
-      la1tokens[i] = false;
-    }
+    boolean[] la1tokens = new boolean[34];
     if (jj_kind >= 0) {
       la1tokens[jj_kind] = true;
       jj_kind = -1;
@@ -1509,7 +1506,7 @@
         }
       }
     }
-    for (int i = 0; i < 33; i++) {
+    for (int i = 0; i < 34; i++) {
       if (la1tokens[i]) {
         jj_expentry = new int[1];
         jj_expentry[0] = i;
@@ -1535,6 +1532,7 @@
   final private void jj_rescan_token() {
     jj_rescan = true;
     for (int i = 0; i < 1; i++) {
+    try {
       JJCalls p = jj_2_rtns[i];
       do {
         if (p.gen > jj_gen) {
@@ -1545,6 +1543,7 @@
         }
         p = p.next;
       } while (p != null);
+      } catch(LookaheadSuccess ls) { }
     }
     jj_rescan = false;
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj?rev=660674&r1=660673&r2=660674&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj Tue May 27 12:55:36
2008
@@ -908,6 +908,7 @@
                        | <_ESCAPED_CHAR> ) >
 | <#_TERM_CHAR: ( <_TERM_START_CHAR> | <_ESCAPED_CHAR> | "-" | "+" ) >
 | <#_WHITESPACE: ( " " | "\t" | "\n" | "\r") >
+| <#_QUOTED_CHAR: ( ~[ "\"", "\\" ] | <_ESCAPED_CHAR> ) >
 }
 
 <DEFAULT, RangeIn, RangeEx> SKIP : {
@@ -925,7 +926,7 @@
 | <COLON:     ":" >
 | <STAR:      "*" >
 | <CARAT:     "^" > : Boost
-| <QUOTED:     "\"" (~["\""] | "\\\"")* "\"">
+| <QUOTED:     "\"" (<_QUOTED_CHAR>)* "\"">
 | <TERM:      <_TERM_START_CHAR> (<_TERM_CHAR>)*  >
 | <FUZZY_SLOP:     "~" ( (<_NUM_CHAR>)+ ( "." (<_NUM_CHAR>)+ )? )? >
 | <PREFIXTERM:  ("*") | ( <_TERM_START_CHAR> (<_TERM_CHAR>)* "*" ) >

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserConstants.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserConstants.java?rev=660674&r1=660673&r2=660674&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserConstants.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserConstants.java Tue
May 27 12:55:36 2008
@@ -9,32 +9,33 @@
   int _TERM_START_CHAR = 3;
   int _TERM_CHAR = 4;
   int _WHITESPACE = 5;
-  int AND = 7;
-  int OR = 8;
-  int NOT = 9;
-  int PLUS = 10;
-  int MINUS = 11;
-  int LPAREN = 12;
-  int RPAREN = 13;
-  int COLON = 14;
-  int STAR = 15;
-  int CARAT = 16;
-  int QUOTED = 17;
-  int TERM = 18;
-  int FUZZY_SLOP = 19;
-  int PREFIXTERM = 20;
-  int WILDTERM = 21;
-  int RANGEIN_START = 22;
-  int RANGEEX_START = 23;
-  int NUMBER = 24;
-  int RANGEIN_TO = 25;
-  int RANGEIN_END = 26;
-  int RANGEIN_QUOTED = 27;
-  int RANGEIN_GOOP = 28;
-  int RANGEEX_TO = 29;
-  int RANGEEX_END = 30;
-  int RANGEEX_QUOTED = 31;
-  int RANGEEX_GOOP = 32;
+  int _QUOTED_CHAR = 6;
+  int AND = 8;
+  int OR = 9;
+  int NOT = 10;
+  int PLUS = 11;
+  int MINUS = 12;
+  int LPAREN = 13;
+  int RPAREN = 14;
+  int COLON = 15;
+  int STAR = 16;
+  int CARAT = 17;
+  int QUOTED = 18;
+  int TERM = 19;
+  int FUZZY_SLOP = 20;
+  int PREFIXTERM = 21;
+  int WILDTERM = 22;
+  int RANGEIN_START = 23;
+  int RANGEEX_START = 24;
+  int NUMBER = 25;
+  int RANGEIN_TO = 26;
+  int RANGEIN_END = 27;
+  int RANGEIN_QUOTED = 28;
+  int RANGEIN_GOOP = 29;
+  int RANGEEX_TO = 30;
+  int RANGEEX_END = 31;
+  int RANGEEX_QUOTED = 32;
+  int RANGEEX_GOOP = 33;
 
   int Boost = 0;
   int RangeEx = 1;
@@ -48,7 +49,8 @@
     "<_TERM_START_CHAR>",
     "<_TERM_CHAR>",
     "<_WHITESPACE>",
-    "<token of kind 6>",
+    "<_QUOTED_CHAR>",
+    "<token of kind 7>",
     "<AND>",
     "<OR>",
     "<NOT>",

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java?rev=660674&r1=660673&r2=660674&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java
(original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParserTokenManager.java
Tue May 27 12:55:36 2008
@@ -45,23 +45,23 @@
    switch(curChar)
    {
       case 40:
-         return jjStopAtPos(0, 12);
-      case 41:
          return jjStopAtPos(0, 13);
+      case 41:
+         return jjStopAtPos(0, 14);
       case 42:
-         return jjStartNfaWithStates_3(0, 15, 36);
+         return jjStartNfaWithStates_3(0, 16, 36);
       case 43:
-         return jjStopAtPos(0, 10);
-      case 45:
          return jjStopAtPos(0, 11);
+      case 45:
+         return jjStopAtPos(0, 12);
       case 58:
-         return jjStopAtPos(0, 14);
+         return jjStopAtPos(0, 15);
       case 91:
-         return jjStopAtPos(0, 22);
+         return jjStopAtPos(0, 23);
       case 94:
-         return jjStopAtPos(0, 16);
+         return jjStopAtPos(0, 17);
       case 123:
-         return jjStopAtPos(0, 23);
+         return jjStopAtPos(0, 24);
       default :
          return jjMoveNfa_3(0, 0);
    }
@@ -125,57 +125,56 @@
                case 25:
                   if ((0xfbfffcf8ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 0:
                   if ((0xfbffd4f8ffffd9ffL & l) != 0L)
                   {
-                     if (kind > 21)
-                        kind = 21;
+                     if (kind > 22)
+                        kind = 22;
                      jjCheckNAddTwoStates(25, 26);
                   }
                   else if ((0x100002600L & l) != 0L)
                   {
-                     if (kind > 6)
-                        kind = 6;
+                     if (kind > 7)
+                        kind = 7;
                   }
                   else if (curChar == 34)
                      jjCheckNAddStates(0, 2);
                   else if (curChar == 33)
                   {
-                     if (kind > 9)
-                        kind = 9;
+                     if (kind > 10)
+                        kind = 10;
                   }
                   if ((0x7bffd0f8ffffd9ffL & l) != 0L)
                   {
-                     if (kind > 18)
-                        kind = 18;
+                     if (kind > 19)
+                        kind = 19;
                      jjCheckNAddStates(3, 7);
                   }
                   else if (curChar == 42)
                   {
-                     if (kind > 20)
-                        kind = 20;
+                     if (kind > 21)
+                        kind = 21;
                   }
                   if (curChar == 38)
                      jjstateSet[jjnewStateCnt++] = 4;
                   break;
                case 4:
-                  if (curChar == 38 && kind > 7)
-                     kind = 7;
+                  if (curChar == 38 && kind > 8)
+                     kind = 8;
                   break;
                case 5:
                   if (curChar == 38)
                      jjstateSet[jjnewStateCnt++] = 4;
                   break;
                case 13:
-                  if (curChar == 33 && kind > 9)
-                     kind = 9;
+                  if (curChar == 33 && kind > 10)
+                     kind = 10;
                   break;
                case 14:
-               case 16:
                   if (curChar == 34)
                      jjCheckNAddStates(0, 2);
                   break;
@@ -183,15 +182,18 @@
                   if ((0xfffffffbffffffffL & l) != 0L)
                      jjCheckNAddStates(0, 2);
                   break;
+               case 17:
+                  jjCheckNAddStates(0, 2);
+                  break;
                case 18:
-                  if (curChar == 34 && kind > 17)
-                     kind = 17;
+                  if (curChar == 34 && kind > 18)
+                     kind = 18;
                   break;
                case 20:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 19)
-                     kind = 19;
+                  if (kind > 20)
+                     kind = 20;
                   jjAddStates(8, 9);
                   break;
                case 21:
@@ -201,43 +203,43 @@
                case 22:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 19)
-                     kind = 19;
+                  if (kind > 20)
+                     kind = 20;
                   jjCheckNAdd(22);
                   break;
                case 23:
-                  if (curChar == 42 && kind > 20)
-                     kind = 20;
+                  if (curChar == 42 && kind > 21)
+                     kind = 21;
                   break;
                case 24:
                   if ((0xfbffd4f8ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 27:
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 28:
                   if ((0x7bffd0f8ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 18)
-                     kind = 18;
+                  if (kind > 19)
+                     kind = 19;
                   jjCheckNAddStates(3, 7);
                   break;
                case 29:
                   if ((0x7bfff8f8ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 18)
-                     kind = 18;
+                  if (kind > 19)
+                     kind = 19;
                   jjCheckNAddTwoStates(29, 30);
                   break;
                case 31:
-                  if (kind > 18)
-                     kind = 18;
+                  if (kind > 19)
+                     kind = 19;
                   jjCheckNAddTwoStates(29, 30);
                   break;
                case 32:
@@ -261,8 +263,8 @@
                case 36:
                   if ((0x97ffffff87ffffffL & l) != 0L)
                   {
-                     if (kind > 21)
-                        kind = 21;
+                     if (kind > 22)
+                        kind = 22;
                      jjCheckNAddTwoStates(25, 26);
                   }
                   else if (curChar == 92)
@@ -271,22 +273,22 @@
                case 0:
                   if ((0x97ffffff87ffffffL & l) != 0L)
                   {
-                     if (kind > 18)
-                        kind = 18;
+                     if (kind > 19)
+                        kind = 19;
                      jjCheckNAddStates(3, 7);
                   }
                   else if (curChar == 92)
                      jjCheckNAddStates(13, 15);
                   else if (curChar == 126)
                   {
-                     if (kind > 19)
-                        kind = 19;
+                     if (kind > 20)
+                        kind = 20;
                      jjstateSet[jjnewStateCnt++] = 20;
                   }
                   if ((0x97ffffff87ffffffL & l) != 0L)
                   {
-                     if (kind > 21)
-                        kind = 21;
+                     if (kind > 22)
+                        kind = 22;
                      jjCheckNAddTwoStates(25, 26);
                   }
                   if (curChar == 78)
@@ -299,8 +301,8 @@
                      jjstateSet[jjnewStateCnt++] = 2;
                   break;
                case 1:
-                  if (curChar == 68 && kind > 7)
-                     kind = 7;
+                  if (curChar == 68 && kind > 8)
+                     kind = 8;
                   break;
                case 2:
                   if (curChar == 78)
@@ -311,24 +313,24 @@
                      jjstateSet[jjnewStateCnt++] = 2;
                   break;
                case 6:
-                  if (curChar == 82 && kind > 8)
-                     kind = 8;
+                  if (curChar == 82 && kind > 9)
+                     kind = 9;
                   break;
                case 7:
                   if (curChar == 79)
                      jjstateSet[jjnewStateCnt++] = 6;
                   break;
                case 8:
-                  if (curChar == 124 && kind > 8)
-                     kind = 8;
+                  if (curChar == 124 && kind > 9)
+                     kind = 9;
                   break;
                case 9:
                   if (curChar == 124)
                      jjstateSet[jjnewStateCnt++] = 8;
                   break;
                case 10:
-                  if (curChar == 84 && kind > 9)
-                     kind = 9;
+                  if (curChar == 84 && kind > 10)
+                     kind = 10;
                   break;
                case 11:
                   if (curChar == 79)
@@ -339,31 +341,35 @@
                      jjstateSet[jjnewStateCnt++] = 11;
                   break;
                case 15:
-                  jjAddStates(0, 2);
+                  if ((0xffffffffefffffffL & l) != 0L)
+                     jjCheckNAddStates(0, 2);
                   break;
-               case 17:
+               case 16:
                   if (curChar == 92)
-                     jjstateSet[jjnewStateCnt++] = 16;
+                     jjstateSet[jjnewStateCnt++] = 17;
+                  break;
+               case 17:
+                  jjCheckNAddStates(0, 2);
                   break;
                case 19:
                   if (curChar != 126)
                      break;
-                  if (kind > 19)
-                     kind = 19;
+                  if (kind > 20)
+                     kind = 20;
                   jjstateSet[jjnewStateCnt++] = 20;
                   break;
                case 24:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 25:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 26:
@@ -371,22 +377,22 @@
                      jjCheckNAddTwoStates(27, 27);
                   break;
                case 27:
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 28:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 18)
-                     kind = 18;
+                  if (kind > 19)
+                     kind = 19;
                   jjCheckNAddStates(3, 7);
                   break;
                case 29:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 18)
-                     kind = 18;
+                  if (kind > 19)
+                     kind = 19;
                   jjCheckNAddTwoStates(29, 30);
                   break;
                case 30:
@@ -394,8 +400,8 @@
                      jjCheckNAddTwoStates(31, 31);
                   break;
                case 31:
-                  if (kind > 18)
-                     kind = 18;
+                  if (kind > 19)
+                     kind = 19;
                   jjCheckNAddTwoStates(29, 30);
                   break;
                case 32:
@@ -433,48 +439,49 @@
                case 27:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 0:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
                   {
-                     if (kind > 21)
-                        kind = 21;
+                     if (kind > 22)
+                        kind = 22;
                      jjCheckNAddTwoStates(25, 26);
                   }
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
                   {
-                     if (kind > 18)
-                        kind = 18;
+                     if (kind > 19)
+                        kind = 19;
                      jjCheckNAddStates(3, 7);
                   }
                   break;
                case 15:
+               case 17:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
-                     jjAddStates(0, 2);
+                     jjCheckNAddStates(0, 2);
                   break;
                case 24:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 28:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 18)
-                     kind = 18;
+                  if (kind > 19)
+                     kind = 19;
                   jjCheckNAddStates(3, 7);
                   break;
                case 29:
                case 31:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 18)
-                     kind = 18;
+                  if (kind > 19)
+                     kind = 19;
                   jjCheckNAddTwoStates(29, 30);
                   break;
                case 32:
@@ -504,9 +511,9 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x20000000L) != 0L)
+         if ((active0 & 0x40000000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 33;
             return 6;
          }
          return -1;
@@ -531,9 +538,9 @@
    switch(curChar)
    {
       case 84:
-         return jjMoveStringLiteralDfa1_1(0x20000000L);
+         return jjMoveStringLiteralDfa1_1(0x40000000L);
       case 125:
-         return jjStopAtPos(0, 30);
+         return jjStopAtPos(0, 31);
       default :
          return jjMoveNfa_1(0, 0);
    }
@@ -548,8 +555,8 @@
    switch(curChar)
    {
       case 79:
-         if ((active0 & 0x20000000L) != 0L)
-            return jjStartNfaWithStates_1(1, 29, 6);
+         if ((active0 & 0x40000000L) != 0L)
+            return jjStartNfaWithStates_1(1, 30, 6);
          break;
       default :
          break;
@@ -578,14 +585,14 @@
                case 0:
                   if ((0xfffffffeffffffffL & l) != 0L)
                   {
-                     if (kind > 32)
-                        kind = 32;
+                     if (kind > 33)
+                        kind = 33;
                      jjCheckNAdd(6);
                   }
                   if ((0x100002600L & l) != 0L)
                   {
-                     if (kind > 6)
-                        kind = 6;
+                     if (kind > 7)
+                        kind = 7;
                   }
                   else if (curChar == 34)
                      jjCheckNAddTwoStates(2, 4);
@@ -603,14 +610,14 @@
                      jjCheckNAddStates(16, 18);
                   break;
                case 5:
-                  if (curChar == 34 && kind > 31)
-                     kind = 31;
+                  if (curChar == 34 && kind > 32)
+                     kind = 32;
                   break;
                case 6:
                   if ((0xfffffffeffffffffL & l) == 0L)
                      break;
-                  if (kind > 32)
-                     kind = 32;
+                  if (kind > 33)
+                     kind = 33;
                   jjCheckNAdd(6);
                   break;
                default : break;
@@ -628,8 +635,8 @@
                case 6:
                   if ((0xdfffffffffffffffL & l) == 0L)
                      break;
-                  if (kind > 32)
-                     kind = 32;
+                  if (kind > 33)
+                     kind = 33;
                   jjCheckNAdd(6);
                   break;
                case 2:
@@ -658,8 +665,8 @@
                case 6:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 32)
-                     kind = 32;
+                  if (kind > 33)
+                     kind = 33;
                   jjCheckNAdd(6);
                   break;
                case 2:
@@ -709,8 +716,8 @@
                case 0:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 24)
-                     kind = 24;
+                  if (kind > 25)
+                     kind = 25;
                   jjAddStates(19, 20);
                   break;
                case 1:
@@ -720,8 +727,8 @@
                case 2:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 24)
-                     kind = 24;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAdd(2);
                   break;
                default : break;
@@ -772,9 +779,9 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x2000000L) != 0L)
+         if ((active0 & 0x4000000L) != 0L)
          {
-            jjmatchedKind = 28;
+            jjmatchedKind = 29;
             return 6;
          }
          return -1;
@@ -799,9 +806,9 @@
    switch(curChar)
    {
       case 84:
-         return jjMoveStringLiteralDfa1_2(0x2000000L);
+         return jjMoveStringLiteralDfa1_2(0x4000000L);
       case 93:
-         return jjStopAtPos(0, 26);
+         return jjStopAtPos(0, 27);
       default :
          return jjMoveNfa_2(0, 0);
    }
@@ -816,8 +823,8 @@
    switch(curChar)
    {
       case 79:
-         if ((active0 & 0x2000000L) != 0L)
-            return jjStartNfaWithStates_2(1, 25, 6);
+         if ((active0 & 0x4000000L) != 0L)
+            return jjStartNfaWithStates_2(1, 26, 6);
          break;
       default :
          break;
@@ -846,14 +853,14 @@
                case 0:
                   if ((0xfffffffeffffffffL & l) != 0L)
                   {
-                     if (kind > 28)
-                        kind = 28;
+                     if (kind > 29)
+                        kind = 29;
                      jjCheckNAdd(6);
                   }
                   if ((0x100002600L & l) != 0L)
                   {
-                     if (kind > 6)
-                        kind = 6;
+                     if (kind > 7)
+                        kind = 7;
                   }
                   else if (curChar == 34)
                      jjCheckNAddTwoStates(2, 4);
@@ -871,14 +878,14 @@
                      jjCheckNAddStates(16, 18);
                   break;
                case 5:
-                  if (curChar == 34 && kind > 27)
-                     kind = 27;
+                  if (curChar == 34 && kind > 28)
+                     kind = 28;
                   break;
                case 6:
                   if ((0xfffffffeffffffffL & l) == 0L)
                      break;
-                  if (kind > 28)
-                     kind = 28;
+                  if (kind > 29)
+                     kind = 29;
                   jjCheckNAdd(6);
                   break;
                default : break;
@@ -896,8 +903,8 @@
                case 6:
                   if ((0xffffffffdfffffffL & l) == 0L)
                      break;
-                  if (kind > 28)
-                     kind = 28;
+                  if (kind > 29)
+                     kind = 29;
                   jjCheckNAdd(6);
                   break;
                case 2:
@@ -926,8 +933,8 @@
                case 6:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 28)
-                     kind = 28;
+                  if (kind > 29)
+                     kind = 29;
                   jjCheckNAdd(6);
                   break;
                case 2:
@@ -952,7 +959,7 @@
    }
 }
 static final int[] jjnextStates = {
-   15, 17, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27, 
+   15, 16, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27, 
    2, 4, 5, 0, 1, 
 };
 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
@@ -968,9 +975,9 @@
    }
 }
 public static final String[] jjstrLiteralImages = {
-"", null, null, null, null, null, null, null, null, null, "\53", "\55", "\50", 
-"\51", "\72", "\52", "\136", null, null, null, null, null, "\133", "\173", null, 
-"\124\117", "\135", null, null, "\124\117", "\175", null, null, };
+"", null, null, null, null, null, null, null, null, null, null, "\53", "\55", 
+"\50", "\51", "\72", "\52", "\136", null, null, null, null, null, "\133", "\173", 
+null, "\124\117", "\135", null, null, "\124\117", "\175", null, null, };
 public static final String[] lexStateNames = {
    "Boost", 
    "RangeEx", 
@@ -978,25 +985,23 @@
    "DEFAULT", 
 };
 public static final int[] jjnewLexState = {
-   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1,
2, 1, 3, 
-   -1, 3, -1, -1, -1, 3, -1, -1, 
+   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1,
-1, 2, 1, 
+   3, -1, 3, -1, -1, -1, 3, -1, -1, 
 };
 static final long[] jjtoToken = {
-   0x1ffffff81L, 
+   0x3ffffff01L, 
 };
 static final long[] jjtoSkip = {
-   0x40L, 
+   0x80L, 
 };
 protected CharStream input_stream;
 private final int[] jjrounds = new int[36];
 private final int[] jjstateSet = new int[72];
 protected char curChar;
-public QueryParserTokenManager(CharStream stream)
-{
+public QueryParserTokenManager(CharStream stream){
    input_stream = stream;
 }
-public QueryParserTokenManager(CharStream stream, int lexState)
-{
+public QueryParserTokenManager(CharStream stream, int lexState){
    this(stream);
    SwitchTo(lexState);
 }

Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java?rev=660674&r1=660673&r2=660674&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java Tue May
27 12:55:36 2008
@@ -614,6 +614,9 @@
     assertQueryEquals("\\\\", a, "\\");  // escaped backslash
     
     assertParseException("\\"); // a backslash must always be escaped
+    
+    // LUCENE-1189
+    assertQueryEquals("(\"a\\\\\") or (\"b\")", a ,"a\\ or b");
   }
 
   public void testQueryStringEscaping() throws Exception {



Mime
View raw message