[Groonga-commit] groonga/groonga at 527dd8f [master] grn_ts: add comments

Back to archive index

susumu.yata null+****@clear*****
Mon Sep 7 16:29:40 JST 2015


susumu.yata	2015-09-07 16:29:40 +0900 (Mon, 07 Sep 2015)

  New Revision: 527dd8fc3fd323c7b6ab20e0a124372ae458b2aa
  https://github.com/groonga/groonga/commit/527dd8fc3fd323c7b6ab20e0a124372ae458b2aa

  Message:
    grn_ts: add comments

  Modified files:
    lib/grn_ts.h
    lib/ts.c

  Modified: lib/grn_ts.h (+5 -1)
===================================================================
--- lib/grn_ts.h    2015-09-07 15:16:40 +0900 (fa6b2df)
+++ lib/grn_ts.h    2015-09-07 16:29:40 +0900 (3cb903d)
@@ -234,7 +234,11 @@ grn_ts_data_type grn_ts_expr_get_data_type(grn_ctx *ctx, grn_ts_expr *expr);
  */
 grn_ts_expr_node *grn_ts_expr_get_root(grn_ctx *ctx, grn_ts_expr *expr);
 
-/* grn_ts_expr_push() pushes expression nodes expressed by a string. */
+/*
+ * grn_ts_expr_push() pushes an expression node expressed by a string.
+ * Note that operators are not supported because some symbols are used as more
+ * than one operators, such as '-' (negative and minus).
+ */
 grn_rc grn_ts_expr_push(grn_ctx *ctx, grn_ts_expr *expr,
                         const char *str, size_t str_size);
 

  Modified: lib/ts.c (+3 -0)
===================================================================
--- lib/ts.c    2015-09-07 15:16:40 +0900 (25921b1)
+++ lib/ts.c    2015-09-07 16:29:40 +0900 (1241595)
@@ -2183,6 +2183,7 @@ grn_ts_expr_push(grn_ctx *ctx, grn_ts_expr *expr,
   } else if ((str_size == 5) && !memcmp(str, "false", 5)) {
     return grn_ts_expr_push_bool(ctx, expr, GRN_FALSE);
   } else if (isdigit((unsigned char)str[0])) {
+    /* Push a number (Int or Float). */
     char *buf, *end;
     grn_rc rc;
     grn_ts_int int_value;
@@ -2207,6 +2208,7 @@ grn_ts_expr_push(grn_ctx *ctx, grn_ts_expr *expr,
     GRN_FREE(buf);
     return rc;
   } else if (str[0] == '"') {
+    /* Push a Text. */
     char *buf;
     size_t i, len, end;
     grn_rc rc;
@@ -2250,6 +2252,7 @@ grn_ts_expr_push(grn_ctx *ctx, grn_ts_expr *expr,
     GRN_FREE(buf);
     return rc;
   } else {
+    /* Push a column. */
     grn_rc rc;
     grn_obj *column = grn_obj_column(ctx, expr->curr_table, str, str_size);
     if (!column) {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index