X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Foptions%2Fparser.yy;h=81415226e82e002e49b947de5645abd11df9b3f9;hb=12a07e58df95bb8dbe167e4157b29c910177ade8;hp=8e87230ade8c10e534d2d3c8db618ea31c3948c3;hpb=d8dedbd561c7cb57daf4192fe57ce5e205bcadd7;p=awesomized%2Flibmemcached diff --git a/libmemcached/options/parser.yy b/libmemcached/options/parser.yy index 8e87230a..81415226 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); @@ -439,8 +445,11 @@ string: } | QUOTED_STRING { + $$= $1; + #if 0 $$.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 + #endif } ;