null+****@clear*****
null+****@clear*****
2010年 8月 2日 (月) 21:46:10 JST
Daijiro MORI 2010-08-02 12:46:10 +0000 (Mon, 02 Aug 2010) New Revision: 73d2e41788c5da7dcafa543ea73078069ed4b1ba Log: support boolean value! Modified files: lib/expr.c Modified: lib/expr.c (+15 -1) =================================================================== --- lib/expr.c 2010-08-02 12:22:29 +0000 (2649c1b) +++ lib/expr.c 2010-08-02 12:46:10 +0000 (b40f8a8) @@ -4879,8 +4879,13 @@ done : } break; case 'f' : - if (len == 6 && !memcmp(q->cur, "false", 6)) { + if (len == 5 && !memcmp(q->cur, "false", 5)) { + grn_obj buf; PARSE(GRN_EXPR_TOKEN_BOOLEAN); + GRN_BOOL_INIT(&buf, 0); + GRN_BOOL_SET(ctx, &buf, 0); + grn_expr_append_const(ctx, q->e, &buf, GRN_OP_PUSH, 1); + GRN_OBJ_FIN(ctx, &buf); goto exit; } break; @@ -4892,13 +4897,22 @@ done : break; case 'n' : if (len == 4 && !memcmp(q->cur, "null", 4)) { + grn_obj buf; PARSE(GRN_EXPR_TOKEN_NULL); + GRN_VOID_INIT(&buf); + grn_expr_append_const(ctx, q->e, &buf, GRN_OP_PUSH, 1); + GRN_OBJ_FIN(ctx, &buf); goto exit; } break; case 't' : if (len == 4 && !memcmp(q->cur, "true", 4)) { + grn_obj buf; PARSE(GRN_EXPR_TOKEN_BOOLEAN); + GRN_BOOL_INIT(&buf, 0); + GRN_BOOL_SET(ctx, &buf, 1); + grn_expr_append_const(ctx, q->e, &buf, GRN_OP_PUSH, 1); + GRN_OBJ_FIN(ctx, &buf); goto exit; } break;