mrubyを超漢字で動作させる
Revisão | e871b77f417538dc181ef69d497262786d96f5c0 (tree) |
---|---|
Hora | 2015-10-21 00:16:46 |
Autor | Seba Gamboa <me@sagm...> |
Commiter | Seba Gamboa |
Increasing docs coverage
@@ -1,6 +1,14 @@ | ||
1 | 1 | --plugin mruby |
2 | 2 | --plugin coderay |
3 | 3 | --output-dir doc/api |
4 | + | |
5 | +src/**/*.c | |
6 | +mrblib/**/*.rb | |
7 | +include/**/*.h | |
8 | + | |
9 | +mrbgems/*/src/**/*.c | |
10 | +mrbgems/*/mrblib/**/*.rb | |
11 | +mrbgems/*/include/**/*.h | |
4 | 12 | - |
5 | 13 | AUTHORS |
6 | 14 | MITL |
@@ -887,9 +887,26 @@ MRB_API mrb_value mrb_attr_get(mrb_state *mrb, mrb_value obj, mrb_sym id); | ||
887 | 887 | MRB_API mrb_bool mrb_respond_to(mrb_state *mrb, mrb_value obj, mrb_sym mid); |
888 | 888 | MRB_API mrb_bool mrb_obj_is_instance_of(mrb_state *mrb, mrb_value obj, struct RClass* c); |
889 | 889 | |
890 | -/* fiber functions (you need to link mruby-fiber mrbgem to use) */ | |
890 | + | |
891 | +/* | |
892 | + * Resume a Fiber | |
893 | + * | |
894 | + * @mrbgem mruby-fiber | |
895 | + */ | |
891 | 896 | MRB_API mrb_value mrb_fiber_resume(mrb_state *mrb, mrb_value fib, mrb_int argc, const mrb_value *argv); |
897 | + | |
898 | +/* | |
899 | + * Yield a Fiber | |
900 | + * | |
901 | + * @mrbgem mruby-fiber | |
902 | + */ | |
892 | 903 | MRB_API mrb_value mrb_fiber_yield(mrb_state *mrb, mrb_int argc, const mrb_value *argv); |
904 | + | |
905 | +/* | |
906 | + * FiberError reference | |
907 | + * | |
908 | + * @mrbgem mruby-fiber | |
909 | + */ | |
893 | 910 | #define E_FIBER_ERROR (mrb_class_get(mrb, "FiberError")) |
894 | 911 | |
895 | 912 | /* memory pool implementation */ |
@@ -1068,7 +1068,7 @@ mrb_init_array(mrb_state *mrb) | ||
1068 | 1068 | { |
1069 | 1069 | struct RClass *a; |
1070 | 1070 | |
1071 | - a = mrb->array_class = mrb_define_class(mrb, "Array", mrb->object_class); /* 15.2.12 */ | |
1071 | + mrb->array_class = a = mrb_define_class(mrb, "Array", mrb->object_class); /* 15.2.12 */ | |
1072 | 1072 | MRB_SET_INSTANCE_TT(a, MRB_TT_ARRAY); |
1073 | 1073 | |
1074 | 1074 | mrb_define_class_method(mrb, a, "[]", mrb_ary_s_create, MRB_ARGS_ANY()); /* 15.2.12.4.1 */ |
@@ -827,7 +827,7 @@ mrb_init_hash(mrb_state *mrb) | ||
827 | 827 | { |
828 | 828 | struct RClass *h; |
829 | 829 | |
830 | - h = mrb->hash_class = mrb_define_class(mrb, "Hash", mrb->object_class); /* 15.2.13 */ | |
830 | + mrb->hash_class = h = mrb_define_class(mrb, "Hash", mrb->object_class); /* 15.2.13 */ | |
831 | 831 | MRB_SET_INSTANCE_TT(h, MRB_TT_HASH); |
832 | 832 | |
833 | 833 | mrb_define_method(mrb, h, "[]", mrb_hash_aget, MRB_ARGS_REQ(1)); /* 15.2.13.4.2 */ |
@@ -1097,7 +1097,7 @@ mrb_init_kernel(mrb_state *mrb) | ||
1097 | 1097 | { |
1098 | 1098 | struct RClass *krn; |
1099 | 1099 | |
1100 | - krn = mrb->kernel_module = mrb_define_module(mrb, "Kernel"); /* 15.3.1 */ | |
1100 | + mrb->kernel_module = krn = mrb_define_module(mrb, "Kernel"); /* 15.3.1 */ | |
1101 | 1101 | mrb_define_class_method(mrb, krn, "block_given?", mrb_f_block_given_p_m, MRB_ARGS_NONE()); /* 15.3.1.2.2 */ |
1102 | 1102 | mrb_define_class_method(mrb, krn, "global_variables", mrb_f_global_variables, MRB_ARGS_NONE()); /* 15.3.1.2.4 */ |
1103 | 1103 | mrb_define_class_method(mrb, krn, "iterator?", mrb_f_block_given_p_m, MRB_ARGS_NONE()); /* 15.3.1.2.5 */ |
@@ -1161,7 +1161,7 @@ mrb_init_numeric(mrb_state *mrb) | ||
1161 | 1161 | mrb_define_method(mrb, integer, "to_int", int_to_i, MRB_ARGS_NONE()); |
1162 | 1162 | |
1163 | 1163 | /* Fixnum Class */ |
1164 | - fixnum = mrb->fixnum_class = mrb_define_class(mrb, "Fixnum", integer); | |
1164 | + mrb->fixnum_class = fixnum = mrb_define_class(mrb, "Fixnum", integer); | |
1165 | 1165 | mrb_define_method(mrb, fixnum, "+", fix_plus, MRB_ARGS_REQ(1)); /* 15.2.8.3.1 */ |
1166 | 1166 | mrb_define_method(mrb, fixnum, "-", fix_minus, MRB_ARGS_REQ(1)); /* 15.2.8.3.2 */ |
1167 | 1167 | mrb_define_method(mrb, fixnum, "*", fix_mul, MRB_ARGS_REQ(1)); /* 15.2.8.3.3 */ |
@@ -1181,7 +1181,7 @@ mrb_init_numeric(mrb_state *mrb) | ||
1181 | 1181 | mrb_define_method(mrb, fixnum, "divmod", fix_divmod, MRB_ARGS_REQ(1)); /* 15.2.8.3.30 (x) */ |
1182 | 1182 | |
1183 | 1183 | /* Float Class */ |
1184 | - fl = mrb->float_class = mrb_define_class(mrb, "Float", numeric); /* 15.2.9 */ | |
1184 | + mrb->float_class = fl = mrb_define_class(mrb, "Float", numeric); /* 15.2.9 */ | |
1185 | 1185 | mrb_undef_class_method(mrb, fl, "new"); |
1186 | 1186 | mrb_define_method(mrb, fl, "+", flo_plus, MRB_ARGS_REQ(1)); /* 15.2.9.3.1 */ |
1187 | 1187 | mrb_define_method(mrb, fl, "-", flo_minus, MRB_ARGS_REQ(1)); /* 15.2.9.3.2 */ |
@@ -264,7 +264,7 @@ mrb_init_object(mrb_state *mrb) | ||
264 | 264 | struct RClass *t; |
265 | 265 | struct RClass *f; |
266 | 266 | |
267 | - n = mrb->nil_class = mrb_define_class(mrb, "NilClass", mrb->object_class); | |
267 | + mrb->nil_class = n = mrb_define_class(mrb, "NilClass", mrb->object_class); | |
268 | 268 | mrb_undef_class_method(mrb, n, "new"); |
269 | 269 | mrb_define_method(mrb, n, "&", false_and, MRB_ARGS_REQ(1)); /* 15.2.4.3.1 */ |
270 | 270 | mrb_define_method(mrb, n, "^", false_xor, MRB_ARGS_REQ(1)); /* 15.2.4.3.2 */ |
@@ -273,7 +273,7 @@ mrb_init_object(mrb_state *mrb) | ||
273 | 273 | mrb_define_method(mrb, n, "to_s", nil_to_s, MRB_ARGS_NONE()); /* 15.2.4.3.5 */ |
274 | 274 | mrb_define_method(mrb, n, "inspect", nil_inspect, MRB_ARGS_NONE()); |
275 | 275 | |
276 | - t = mrb->true_class = mrb_define_class(mrb, "TrueClass", mrb->object_class); | |
276 | + mrb->true_class = t = mrb_define_class(mrb, "TrueClass", mrb->object_class); | |
277 | 277 | mrb_undef_class_method(mrb, t, "new"); |
278 | 278 | mrb_define_method(mrb, t, "&", true_and, MRB_ARGS_REQ(1)); /* 15.2.5.3.1 */ |
279 | 279 | mrb_define_method(mrb, t, "^", true_xor, MRB_ARGS_REQ(1)); /* 15.2.5.3.2 */ |
@@ -281,7 +281,7 @@ mrb_init_object(mrb_state *mrb) | ||
281 | 281 | mrb_define_method(mrb, t, "|", true_or, MRB_ARGS_REQ(1)); /* 15.2.5.3.4 */ |
282 | 282 | mrb_define_method(mrb, t, "inspect", true_to_s, MRB_ARGS_NONE()); |
283 | 283 | |
284 | - f = mrb->false_class = mrb_define_class(mrb, "FalseClass", mrb->object_class); | |
284 | + mrb->false_class = f = mrb_define_class(mrb, "FalseClass", mrb->object_class); | |
285 | 285 | mrb_undef_class_method(mrb, f, "new"); |
286 | 286 | mrb_define_method(mrb, f, "&", false_and, MRB_ARGS_REQ(1)); /* 15.2.6.3.1 */ |
287 | 287 | mrb_define_method(mrb, f, "^", false_xor, MRB_ARGS_REQ(1)); /* 15.2.6.3.2 */ |
@@ -2674,7 +2674,7 @@ mrb_init_string(mrb_state *mrb) | ||
2674 | 2674 | |
2675 | 2675 | mrb_static_assert(RSTRING_EMBED_LEN_MAX < (1 << 5), "pointer size too big for embedded string"); |
2676 | 2676 | |
2677 | - s = mrb->string_class = mrb_define_class(mrb, "String", mrb->object_class); /* 15.2.10 */ | |
2677 | + mrb->string_class = s = mrb_define_class(mrb, "String", mrb->object_class); /* 15.2.10 */ | |
2678 | 2678 | MRB_SET_INSTANCE_TT(s, MRB_TT_STRING); |
2679 | 2679 | |
2680 | 2680 | mrb_define_method(mrb, s, "bytesize", mrb_str_bytesize, MRB_ARGS_NONE()); |
@@ -478,7 +478,7 @@ mrb_init_symbol(mrb_state *mrb) | ||
478 | 478 | { |
479 | 479 | struct RClass *sym; |
480 | 480 | |
481 | - sym = mrb->symbol_class = mrb_define_class(mrb, "Symbol", mrb->object_class); /* 15.2.11 */ | |
481 | + mrb->symbol_class = sym = mrb_define_class(mrb, "Symbol", mrb->object_class); /* 15.2.11 */ | |
482 | 482 | |
483 | 483 | mrb_define_method(mrb, sym, "===", sym_equal, MRB_ARGS_REQ(1)); /* 15.2.11.3.1 */ |
484 | 484 | mrb_define_method(mrb, sym, "id2name", mrb_sym_to_s, MRB_ARGS_NONE()); /* 15.2.11.3.2 */ |