Navigation Menu

Skip to content

Commit

Permalink
mrb: bind expr_code.flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 16, 2014
1 parent 3b2c6b8 commit 61bcd0e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/mrb/mrb_expr.c
Expand Up @@ -488,6 +488,15 @@ mrb_grn_expr_code_get_op(mrb_state *mrb, mrb_value self)
return mrb_fixnum_value(expr_code->op);
}

static mrb_value
mrb_grn_expr_code_get_flags(mrb_state *mrb, mrb_value self)
{
grn_expr_code *expr_code;

expr_code = DATA_PTR(self);
return mrb_fixnum_value(expr_code->flags);
}

static mrb_value
mrb_grn_expression_initialize(mrb_state *mrb, mrb_value self)
{
Expand Down Expand Up @@ -576,6 +585,8 @@ grn_mrb_expr_init(grn_ctx *ctx)
mrb_grn_expr_code_get_value, MRB_ARGS_NONE());
mrb_define_method(mrb, klass, "op",
mrb_grn_expr_code_get_op, MRB_ARGS_NONE());
mrb_define_method(mrb, klass, "flags",
mrb_grn_expr_code_get_flags, MRB_ARGS_NONE());

klass = mrb_define_class_under(mrb, module, "Expression", object_class);
MRB_SET_INSTANCE_TT(klass, MRB_TT_DATA);
Expand Down

0 comments on commit 61bcd0e

Please sign in to comment.