[Groonga-commit] groonga/gcs [master] q: support <\"> in phrase term

Back to archive index

null+****@clear***** null+****@clear*****
2012年 8月 3日 (金) 22:23:48 JST


Kouhei Sutou	2012-08-03 22:23:48 +0900 (Fri, 03 Aug 2012)

  New Revision: 61c70feb265766663feb6bdec8485e704f040216
  https://github.com/groonga/gcs/commit/61c70feb265766663feb6bdec8485e704f040216

  Log:
    q: support <\"> in phrase term

  Modified files:
    lib/q-translator.js
    test/q-translator.test.js

  Modified: lib/q-translator.js (+1 -0)
===================================================================
--- lib/q-translator.js    2012-08-03 22:14:05 +0900 (e241476)
+++ lib/q-translator.js    2012-08-03 22:23:48 +0900 (2cad349)
@@ -48,6 +48,7 @@ QueryTranslator.prototype = {
       }
 
       if (character == "\\") {
+        phrase += character;
         this.offset++;
         character = this.query[this.offset];
       }

  Modified: test/q-translator.test.js (+4 -0)
===================================================================
--- test/q-translator.test.js    2012-08-03 22:14:05 +0900 (a10b078)
+++ test/q-translator.test.js    2012-08-03 22:23:48 +0900 (2f2b650)
@@ -72,6 +72,10 @@ suite('QueryTranslator', function() {
                  '"star wars" luke',
                  '"star wars"'.length,
                  "'\"star wars\"'");
+  testPhraseTerm("escape",
+                 '"star \\" wars" luke',
+                 '"star \\" wars"'.length,
+                 "'\"star \\\" wars\"'");
 
   testTerm("a term",
            "  star wars",
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index