Shift = over being done by scanner, ie faster match.
authorBrian Aker <brian@tangent.org>
Sun, 27 Mar 2011 00:40:48 +0000 (17:40 -0700)
committerBrian Aker <brian@tangent.org>
Sun, 27 Mar 2011 00:40:48 +0000 (17:40 -0700)
libmemcached/options/parser.yy
libmemcached/options/scanner.l

index 6145ec728c19efd8e8755ad1d8513e77a46ac398..31371c1b6e388f3975d925e73b86c3499c7f74ed 100644 (file)
@@ -221,30 +221,30 @@ expression:
         ;
 
 behaviors:
-          PREFIX_KEY '=' string
+          PREFIX_KEY string
           {
-            if ((context->rc= memcached_set_prefix_key(context->memc, $3.c_str, $3.length)) != MEMCACHED_SUCCESS)
+            if ((context->rc= memcached_set_prefix_key(context->memc, $2.c_str, $2.length)) != MEMCACHED_SUCCESS)
             {
               parser_abort(context, NULL);;
             }
           }
-        | DISTRIBUTION '=' distribution
+        | DISTRIBUTION distribution
           {
-            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, $3)) != MEMCACHED_SUCCESS)
+            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, $2)) != MEMCACHED_SUCCESS)
             {
               parser_abort(context, NULL);;
             }
           }
-        | HASH '=' hash
+        | HASH hash
           {
-            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, $3)) != MEMCACHED_SUCCESS)
+            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, $2)) != MEMCACHED_SUCCESS)
             {
               parser_abort(context, NULL);; 
             }
           }
-        | KETAMA_HASH '=' hash
+        | KETAMA_HASH hash
           {
-            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_KETAMA_HASH, $3)) != MEMCACHED_SUCCESS)
+            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_KETAMA_HASH, $2)) != MEMCACHED_SUCCESS)
             {
               parser_abort(context, NULL);;
             }
index 67fdb96d4903f0bb5adaabdd17fa56e8f19b4c1a..6e58f3f84fcfd1a0570375e647304557c9e20641 100644 (file)
@@ -103,8 +103,8 @@ static void get_lex_chars(char* buffer, int& result, int max_size, Context *cont
 "--CONNECT_TIMEOUT"                    { yyextra->begin= yytext; return CONNECT_TIMEOUT; }
 "--CONNECT-TIMEOUT"                    { yyextra->begin= yytext; return CONNECT_TIMEOUT; }
 "--CORK"                               { yyextra->begin= yytext; return _CORK; }
-"--DISTRIBUTION                      { yyextra->begin= yytext; return DISTRIBUTION; }
-"--HASH                              { yyextra->begin= yytext; return HASH; }
+"--DISTRIBUTION="                      { yyextra->begin= yytext; return DISTRIBUTION; }
+"--HASH="                              { yyextra->begin= yytext; return HASH; }
 "--HASH_WITH_PREFIX_KEY"               { yyextra->begin= yytext; return HASH_WITH_PREFIX_KEY; }
 "--HASH-WITH-PREFIX_KEY"               { yyextra->begin= yytext; return HASH_WITH_PREFIX_KEY; }
 "--IO_BYTES_WATERMARK"         { yyextra->begin= yytext; return IO_BYTES_WATERMARK; }
@@ -114,8 +114,8 @@ static void get_lex_chars(char* buffer, int& result, int max_size, Context *cont
 "--IO_MSG_WATERMARK"           { yyextra->begin= yytext; return IO_MSG_WATERMARK; }
 "--IO-MSG-WATERMARK"           { yyextra->begin= yytext; return IO_MSG_WATERMARK; }
 "--KETAMA"                             { yyextra->begin= yytext; return KETAMA; }
-"--KETAMA_HASH                       { yyextra->begin= yytext; return KETAMA_HASH; }
-"--KETAMA-HASH                       { yyextra->begin= yytext; return KETAMA_HASH; }
+"--KETAMA_HASH="                       { yyextra->begin= yytext; return KETAMA_HASH; }
+"--KETAMA-HASH="                       { yyextra->begin= yytext; return KETAMA_HASH; }
 "--KETAMA_WEIGHTED"                    { yyextra->begin= yytext; return KETAMA_WEIGHTED; }
 "--KETAMA-WEIGHTED"                    { yyextra->begin= yytext; return KETAMA_WEIGHTED; }
 "--NOREPLY"                         { yyextra->begin= yytext; return NOREPLY; }
@@ -152,8 +152,8 @@ static void get_lex_chars(char* buffer, int& result, int max_size, Context *cont
 "--USE_UDP"                            { yyextra->begin= yytext; return USE_UDP; }
 "--USE-UDP"                            { yyextra->begin= yytext; return USE_UDP; }
 
-"--PREFIX-KEY"                         { yyextra->begin= yytext; return PREFIX_KEY; }
-"--PREFIX_KEY"                         { yyextra->begin= yytext; return PREFIX_KEY; }
+"--PREFIX-KEY="                                { yyextra->begin= yytext; return PREFIX_KEY; }
+"--PREFIX_KEY="                                { yyextra->begin= yytext; return PREFIX_KEY; }
 
 INCLUDE           { yyextra->begin= yytext; return INCLUDE; }
 RESET           { yyextra->begin= yytext; return RESET; }