[Groonga-commit] groonga/groonga at 766d03d [master] mrb: add Expression::SYNTAX_* and Expression::ALLOW_*

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Mar 16 14:45:40 JST 2017


Kouhei Sutou	2017-03-16 14:45:40 +0900 (Thu, 16 Mar 2017)

  New Revision: 766d03d4a3d3e655e0160126a42d99b1d2fa9404
  https://github.com/groonga/groonga/commit/766d03d4a3d3e655e0160126a42d99b1d2fa9404

  Message:
    mrb: add Expression::SYNTAX_* and Expression::ALLOW_*

  Modified files:
    lib/mrb/mrb_expr.c

  Modified: lib/mrb/mrb_expr.c (+15 -0)
===================================================================
--- lib/mrb/mrb_expr.c    2017-03-16 14:45:29 +0900 (5828144)
+++ lib/mrb/mrb_expr.c    2017-03-16 14:45:40 +0900 (b56fe61)
@@ -891,6 +891,21 @@ grn_mrb_expr_init(grn_ctx *ctx)
   klass = mrb_define_class_under(mrb, module, "Expression", object_class);
   MRB_SET_INSTANCE_TT(klass, MRB_TT_DATA);
 
+#define DEFINE_FLAG(name)                               \
+  mrb_define_const(mrb, klass,                          \
+                   #name,                               \
+                   mrb_fixnum_value(GRN_EXPR_ ## name))
+
+  DEFINE_FLAG(SYNTAX_QUERY);
+  DEFINE_FLAG(SYNTAX_SCRIPT);
+  DEFINE_FLAG(SYNTAX_OUTPUT_COLUMNS);
+  DEFINE_FLAG(ALLOW_PRAGMA);
+  DEFINE_FLAG(ALLOW_COLUMN);
+  DEFINE_FLAG(ALLOW_UPDATE);
+  DEFINE_FLAG(ALLOW_LEADING_NOT);
+
+#undef DEFINE_FLAG
+
   mrb_define_class_method(mrb, klass, "create",
                           mrb_grn_expression_class_create,
                           MRB_ARGS_REQ(1));
-------------- next part --------------
HTML����������������������������...
Download 



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