X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Foptions%2Fparser.yy;h=f9d1f1e2a5d72cd1dd978b2612e0ba9224db68a3;hb=609d07c5a051c301ce6595747c2f64d3819554f5;hp=722ced5f9db6ffd41669cd9a96336f0624671ea7;hpb=9fd31c03436acf24c593dc3a77c905eb137ef570;p=awesomized%2Flibmemcached diff --git a/libmemcached/options/parser.yy b/libmemcached/options/parser.yy index 722ced5f..f9d1f1e2 100644 --- a/libmemcached/options/parser.yy +++ b/libmemcached/options/parser.yy @@ -29,16 +29,12 @@ %parse-param { Context *context } %parse-param { yyscan_t *scanner } %pure-parser -%require "2.2" +%require "2.4" %start begin %verbose %{ -#include - -#include - #include #include @@ -46,6 +42,8 @@ #include #include +#include + #pragma GCC diagnostic ignored "-Wold-style-cast" int conf_lex(YYSTYPE* lvalp, void* scanner); @@ -69,6 +67,7 @@ inline void config_error(Context *context, yyscan_t *scanner, const char *error) %token CONFIGURE_FILE %token EMPTY_LINE %token SERVER +%token SOCKET %token SERVERS %token SERVERS_OPTION %token UNKNOWN_OPTION @@ -212,6 +211,13 @@ expression: } context->unset_server(); } + | SOCKET string optional_weight + { + if (memcached_failed(context->rc= memcached_server_add_unix_socket_with_weight(context->memc, $2.c_str, $3))) + { + parser_abort(context, NULL); + } + } | CONFIGURE_FILE string { memcached_set_configuration_file(context->memc, $2.c_str, $2.size); @@ -230,7 +236,7 @@ expression: behaviors: NAMESPACE string { - if ((context->rc= memcached_set_prefix_key(context->memc, $2.c_str, $2.size)) != MEMCACHED_SUCCESS) + if ((context->rc= memcached_set_namespace(context->memc, $2.c_str, $2.size)) != MEMCACHED_SUCCESS) { parser_abort(context, NULL);; } @@ -439,8 +445,7 @@ string: } | QUOTED_STRING { - $$.c_str= $1.c_str +1; // +1 to move use passed the initial quote - $$.size= $1.size -2; // -2 removes the begin and end quote + $$= $1; } ;