X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Foptions%2Fparser.yy;h=6a7bd9b9f7378d3c011a00e61265db5fbfa8f98c;hb=cb9cdd2652b441d362fdcbd3f185652f941d3108;hp=e7fb84ed972b09c02299fa1e197cdab50b84142a;hpb=4924131d4d62d724d7e590cb2c5668ac5c8a3006;p=awesomized%2Flibmemcached diff --git a/libmemcached/options/parser.yy b/libmemcached/options/parser.yy index e7fb84ed..6a7bd9b9 100644 --- a/libmemcached/options/parser.yy +++ b/libmemcached/options/parser.yy @@ -135,19 +135,21 @@ inline void config_error(Context *context, yyscan_t *scanner, const char *error) %token FLOAT %token NUMBER -%token PORT -%token WEIGHT_START +%token PORT +%token WEIGHT_START %token IPADDRESS %token HOSTNAME %token STRING %token QUOTED_STRING %token FILE_PATH -%type string -%type distribution -%type hash %type behavior_boolean %type behavior_number +%type distribution +%type hash +%type optional_port +%type optional_weight +%type string %% @@ -194,7 +196,7 @@ statement: expression: SERVER HOSTNAME optional_port optional_weight { - if ((context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $2.port, $2.weight)) != MEMCACHED_SUCCESS) + if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $3, $4))) { parser_abort(context, NULL); } @@ -202,7 +204,7 @@ expression: } | SERVER IPADDRESS optional_port optional_weight { - if ((context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $2.port, $2.weight)) != MEMCACHED_SUCCESS) + if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $3, $4))) { parser_abort(context, NULL); } @@ -378,13 +380,13 @@ behavior_boolean: optional_port: - { } + { $$= MEMCACHED_DEFAULT_PORT;} | PORT { }; ; optional_weight: - { } + { $$= 1; } | WEIGHT_START { } ;