Kouhei Sutou
null+****@clear*****
Sat Feb 20 18:44:12 JST 2016
Kouhei Sutou 2016-02-20 18:44:12 +0900 (Sat, 20 Feb 2016) New Revision: 8f2742a0797d745b3e4d608ca9c6c12d16ab58d9 https://github.com/groonga/groonga/commit/8f2742a0797d745b3e4d608ca9c6c12d16ab58d9 Message: Use more meaningful variable name Modified files: lib/expr.c lib/grn_ecmascript.lemon Modified: lib/expr.c (+5 -5) =================================================================== --- lib/expr.c 2016-02-20 18:43:56 +0900 (fb4f99d) +++ lib/expr.c 2016-02-20 18:44:12 +0900 (20a3e29) @@ -6331,7 +6331,7 @@ typedef struct { int weight_offset; grn_hash *weight_set; snip_cond *snip_conds; - grn_hash *hash_args; + grn_hash *object_literal; } efs_info; typedef struct { @@ -7546,7 +7546,7 @@ grn_expr_parse(grn_ctx *ctx, grn_obj *expr, efsi.weight_offset = 0; efsi.opt.weight_vector = NULL; efsi.weight_set = NULL; - efsi.hash_args = NULL; + efsi.object_literal = NULL; if (flags & (GRN_EXPR_SYNTAX_SCRIPT | GRN_EXPR_SYNTAX_OUTPUT_COLUMNS | @@ -7584,12 +7584,12 @@ grn_expr_parse(grn_ctx *ctx, grn_obj *expr, GRN_OBJ_FIN(ctx, &efsi.column_stack); GRN_OBJ_FIN(ctx, &efsi.token_stack); GRN_OBJ_FIN(ctx, &efsi.buf); - if (efsi.hash_args) { + if (efsi.object_literal) { grn_obj *value; - GRN_HASH_EACH(ctx, efsi.hash_args, i, NULL, NULL, (void **)&value, { + GRN_HASH_EACH(ctx, efsi.object_literal, i, NULL, NULL, (void **)&value, { GRN_OBJ_FIN(ctx, value); }); - grn_hash_close(ctx, efsi.hash_args); + grn_hash_close(ctx, efsi.object_literal); } } else { ERR(GRN_INVALID_ARGUMENT, "variable is not defined correctly"); Modified: lib/grn_ecmascript.lemon (+6 -6) =================================================================== --- lib/grn_ecmascript.lemon 2016-02-20 18:43:56 +0900 (69a6c55) +++ lib/grn_ecmascript.lemon 2016-02-20 18:44:12 +0900 (084f34b) @@ -386,9 +386,9 @@ element_list ::= element_list elision assignment_expression. object_literal ::= BRACEL property_name_and_value_list BRACER. { grn_ctx *ctx = efsi->ctx; grn_expr *e = (grn_expr *)(efsi->e); - grn_expr_append_const_ptr(ctx, (grn_obj *)e, (grn_obj *)efsi->hash_args, + grn_expr_append_const_ptr(ctx, (grn_obj *)e, (grn_obj *)efsi->object_literal, GRN_OP_PUSH, 1); - efsi->hash_args = NULL; + efsi->object_literal = NULL; } property_name_and_value_list ::= . @@ -401,20 +401,20 @@ property_name_and_value ::= property_name COLON assignment_expression. { grn_obj *property = e->codes[e->codes_curr - 3].value; grn_obj *value = e->codes[e->codes_curr - 1].value; - if (!efsi->hash_args) { - efsi->hash_args = + if (!efsi->object_literal) { + efsi->object_literal = grn_hash_create(ctx, NULL, GRN_TABLE_MAX_KEY_SIZE, sizeof(grn_obj), GRN_OBJ_KEY_VAR_SIZE|GRN_OBJ_TEMPORARY|GRN_HASH_TINY); } - if (!efsi->hash_args) { + if (!efsi->object_literal) { ERR(GRN_NO_MEMORY_AVAILABLE, "couldn't create hash table for parsing object literal: <%.*s>", (int)(efsi->str_end - efsi->str), efsi->str); } else { grn_obj *buf; int added; - if (grn_hash_add(ctx, (grn_hash *)efsi->hash_args, + if (grn_hash_add(ctx, (grn_hash *)efsi->object_literal, GRN_TEXT_VALUE(property), GRN_TEXT_LEN(property), (void **)&buf, &added)) { if (added) { -------------- next part -------------- HTML����������������������������... Download