Fix need for permissive.-------------- This line and the following will be ignored...
[awesomized/libmemcached] / libmemcached / options / parser.yy
index 6071a99bd02c83087c3259b94870a69d6c090646..db311402b45c7795908d6b447c11d0cdd6417e43 100644 (file)
@@ -59,13 +59,6 @@ inline void config_error(Context *context, yyscan_t *scanner, const char *error)
     parser::abort_func(context, error);
 }
 
-int config_parse(Context*, yyscan_t *);
-
-void Context::start() 
-{
-  config_parse(this, scanner);
-}
-
 %}
 
 %token COMMENT
@@ -88,14 +81,12 @@ void Context::start()
 %token BUFFER_REQUESTS
 %token CACHE_LOOKUPS
 %token CONNECT_TIMEOUT
-%token _CORK
 %token DISTRIBUTION
 %token HASH
 %token HASH_WITH_PREFIX_KEY
 %token IO_BYTES_WATERMARK
 %token IO_KEY_PREFETCH
 %token IO_MSG_WATERMARK
-%token KETAMA
 %token KETAMA_HASH
 %token KETAMA_WEIGHTED
 %token NOREPLY
@@ -235,18 +226,22 @@ behaviors:
               parser_abort(context, NULL);;
             }
           }
-        | HASH hash
+        | DISTRIBUTION distribution ',' hash
           {
-            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, $2)) != MEMCACHED_SUCCESS)
+            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, $2)) != MEMCACHED_SUCCESS)
             {
-              parser_abort(context, NULL);; 
+              parser_abort(context, NULL);;
+            }
+            if ((context->rc= memcached_behavior_set_distribution_hash(context->memc, $4)) != MEMCACHED_SUCCESS)
+            {
+              parser_abort(context, NULL);;
             }
           }
-        | KETAMA_HASH hash
+        | HASH hash
           {
-            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_KETAMA_HASH, $2)) != MEMCACHED_SUCCESS)
+            if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, $2)) != MEMCACHED_SUCCESS)
             {
-              parser_abort(context, NULL);;
+              parser_abort(context, NULL);; 
             }
           }
         | behavior_number NUMBER
@@ -336,18 +331,10 @@ behavior_boolean:
           {
             $$= MEMCACHED_BEHAVIOR_CACHE_LOOKUPS;
           }
-        | _CORK
-          {
-            $$= MEMCACHED_BEHAVIOR_CORK;
-          }
         | HASH_WITH_PREFIX_KEY
           {
             $$= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY;
           }
-        | KETAMA
-          {
-            $$= MEMCACHED_BEHAVIOR_KETAMA;
-          }
         | KETAMA_WEIGHTED
           {
             $$= MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED;
@@ -505,3 +492,11 @@ distribution:
             $$= MEMCACHED_DISTRIBUTION_RANDOM;
           }
         ;
+
+%% 
+
+void Context::start() 
+{
+  config_parse(this, (void **)scanner);
+}
+