mrubyを超漢字で動作させる
Révision | 6ce31f334eec218905035fc5a3e8b1b7d43fae3e (tree) |
---|---|
l'heure | 2015-11-17 02:54:19 |
Auteur | Yukihiro "Matz" Matsumoto <matz@ruby...> |
Commiter | Yukihiro "Matz" Matsumoto |
Merge pull request #3017 from Mav7/master
Added type annotation to YARD.
@@ -189,19 +189,19 @@ typedef mrb_value (*mrb_func_t)(mrb_state *mrb, mrb_value); | ||
189 | 189 | * //free(TheAnimals); |
190 | 190 | * } |
191 | 191 | * |
192 | - * @param mrb The current mruby state. | |
193 | - * @param name The name of the defined class | |
194 | - * @param super The new class parent | |
195 | - * @return Reference to the newly defined class | |
192 | + * @param [mrb_state *] mrb The current mruby state. | |
193 | + * @param [const char *] name The name of the defined class. | |
194 | + * @param [struct RClass *] super The new class parent. | |
195 | + * @return [struct RClass *] Reference to the newly defined class. | |
196 | 196 | * @see mrb_define_class_under |
197 | 197 | */ |
198 | 198 | MRB_API struct RClass *mrb_define_class(mrb_state *mrb, const char *name, struct RClass *super); |
199 | 199 | |
200 | 200 | /** |
201 | 201 | * Defines a new module. |
202 | - * @param mrb_state* The current mruby state. | |
203 | - * @param char* The name of the module. | |
204 | - * @return Reference to the newly defined module. | |
202 | + * @param [mrb_state *] mrb_state* The current mruby state. | |
203 | + * @param [const char *] char* The name of the module. | |
204 | + * @return [struct RClass *] Reference to the newly defined module. | |
205 | 205 | */ |
206 | 206 | MRB_API struct RClass *mrb_define_module(mrb_state *, const char*); |
207 | 207 | MRB_API mrb_value mrb_singleton_class(mrb_state*, mrb_value); |
@@ -213,9 +213,9 @@ MRB_API mrb_value mrb_singleton_class(mrb_state*, mrb_value); | ||
213 | 213 | * module B |
214 | 214 | * include A |
215 | 215 | * end |
216 | - * @param mrb_state* The current mruby state. | |
217 | - * @param RClass* A reference to module or a class. | |
218 | - * @param RClass* A reference to the module to be included. | |
216 | + * @param [mrb_state *] mrb_state* The current mruby state. | |
217 | + * @param [struct RClass *] RClass* A reference to module or a class. | |
218 | + * @param [struct RClass *] RClass* A reference to the module to be included. | |
219 | 219 | */ |
220 | 220 | MRB_API void mrb_include_module(mrb_state*, struct RClass*, struct RClass*); |
221 | 221 |
@@ -226,9 +226,9 @@ MRB_API void mrb_include_module(mrb_state*, struct RClass*, struct RClass*); | ||
226 | 226 | * module B |
227 | 227 | * prepend A |
228 | 228 | * end |
229 | - * @param mrb_state* The current mruby state. | |
230 | - * @param RClass* A reference to module or a class. | |
231 | - * @param RClass* A reference to the module to be prepended. | |
229 | + * @param [mrb_state *] mrb_state* The current mruby state. | |
230 | + * @param [struct RClass *] RClass* A reference to module or a class. | |
231 | + * @param [struct RClass *] RClass* A reference to the module to be prepended. | |
232 | 232 | */ |
233 | 233 | MRB_API void mrb_prepend_module(mrb_state*, struct RClass*, struct RClass*); |
234 | 234 |
@@ -251,10 +251,11 @@ MRB_API void mrb_prepend_module(mrb_state*, struct RClass*, struct RClass*); | ||
251 | 251 | * mrb_define_method(mrb, mrb->kernel_module, "example_method", example_method, MRB_ARGS_NONE()); |
252 | 252 | * } |
253 | 253 | * |
254 | - * @param mrb The MRuby state reference. | |
255 | - * @param cla The class pointer where the method will be defined. | |
256 | - * @param func The function pointer to the method definition. | |
257 | - * @param aspec The method parameters declaration. | |
254 | + * @param [mrb_state *] mrb The MRuby state reference. | |
255 | + * @param [struct RClass *] cla The class pointer where the method will be defined. | |
256 | + * @param [const char *] name The name of the method being defined. | |
257 | + * @param [mrb_func_t] func The function pointer to the method definition. | |
258 | + * @param [mrb_aspec] aspec The method parameters declaration. | |
258 | 259 | */ |
259 | 260 | MRB_API void mrb_define_method(mrb_state *mrb, struct RClass *cla, const char *name, mrb_func_t func, mrb_aspec aspec); |
260 | 261 |
@@ -284,11 +285,11 @@ MRB_API void mrb_define_method(mrb_state *mrb, struct RClass *cla, const char *n | ||
284 | 285 | * mrb_define_class_method(mrb, foo, "bar", bar_method, MRB_ARGS_NONE()); |
285 | 286 | * |
286 | 287 | * } |
287 | - * @param mrb_state* The MRuby state reference. | |
288 | - * @param RClass* The class where the class method will be defined. | |
289 | - * @param char* The name of the class method. | |
290 | - * @param mrb_func_t The function pointer to the class method definition. | |
291 | - * @param mrb_aspec The method parameters declaration. | |
288 | + * @param [mrb_state *] mrb_state* The MRuby state reference. | |
289 | + * @param [struct RClass *] RClass* The class where the class method will be defined. | |
290 | + * @param [const char *] char* The name of the class method being defined. | |
291 | + * @param [mrb_func_t] mrb_func_t The function pointer to the class method definition. | |
292 | + * @param [mrb_aspec] mrb_aspec The method parameters declaration. | |
292 | 293 | */ |
293 | 294 | MRB_API void mrb_define_class_method(mrb_state *, struct RClass *, const char *, mrb_func_t, mrb_aspec); |
294 | 295 | MRB_API void mrb_define_singleton_method(mrb_state*, struct RObject*, const char*, mrb_func_t, mrb_aspec); |
@@ -317,11 +318,11 @@ MRB_API void mrb_define_singleton_method(mrb_state*, struct RObject*, const char | ||
317 | 318 | * mrb_define_module_function(mrb, foo, "bar", bar_method, MRB_ARGS_NONE()); |
318 | 319 | * |
319 | 320 | * } |
320 | - * @param mrb_state* The MRuby state reference. | |
321 | - * @param RClass* The module where the module function will be defined. | |
322 | - * @param char* The name of the module function. | |
323 | - * @param mrb_func_t The function pointer to the module function definition. | |
324 | - * @param mrb_aspec The method parameters declaration. | |
321 | + * @param [mrb_state *] mrb_state* The MRuby state reference. | |
322 | + * @param [struct RClass *] RClass* The module where the module function will be defined. | |
323 | + * @param [const char *] char* The name of the module function being defined. | |
324 | + * @param [mrb_func_t] mrb_func_t The function pointer to the module function definition. | |
325 | + * @param [mrb_aspec] mrb_aspec The method parameters declaration. | |
325 | 326 | */ |
326 | 327 | MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*, mrb_func_t, mrb_aspec); |
327 | 328 |
@@ -352,10 +353,10 @@ MRB_API void mrb_define_module_function(mrb_state*, struct RClass*, const char*, | ||
352 | 353 | * mrb_example_gem_final(mrb_state* mrb){ |
353 | 354 | * |
354 | 355 | * } |
355 | - * @param mrb_state* The MRuby state reference. | |
356 | - * @param RClass* A class or module the constant is defined in. | |
357 | - * @param name The name of the constant. | |
358 | - * @param mrb_value The value for the constant. | |
356 | + * @param [mrb_state *] mrb_state* The MRuby state reference. | |
357 | + * @param [struct RClass *] RClass* A class or module the constant is defined in. | |
358 | + * @param [const char *] name The name of the constant being defined. | |
359 | + * @param [mrb_value] mrb_value The value for the constant. | |
359 | 360 | */ |
360 | 361 | MRB_API void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_value); |
361 | 362 |
@@ -416,9 +417,9 @@ MRB_API void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_ | ||
416 | 417 | * |
417 | 418 | * } |
418 | 419 | * |
419 | - * @param mrb_state* The mruby state reference. | |
420 | - * @param RClass* A class the method will be undefined from. | |
421 | - * @param constchar* The name of the method to be undefined. | |
420 | + * @param [mrb_state*] mrb_state* The mruby state reference. | |
421 | + * @param [struct RClass*] RClass* A class the method will be undefined from. | |
422 | + * @param [const char*] constchar* The name of the method to be undefined. | |
422 | 423 | */ |
423 | 424 | MRB_API void mrb_undef_method(mrb_state*, struct RClass*, const char*); |
424 | 425 |
@@ -465,9 +466,9 @@ MRB_API void mrb_undef_method(mrb_state*, struct RClass*, const char*); | ||
465 | 466 | * mrb_example_gem_final(mrb_state* mrb){ |
466 | 467 | * |
467 | 468 | * } |
468 | - * @param mrb_state* The mruby state reference. | |
469 | - * @param RClass* A class the class method will be undefined from. | |
470 | - * @param constchar* The name of the class method to be undefined. | |
469 | + * @param [mrb_state*] mrb_state* The mruby state reference. | |
470 | + * @param [RClass*] RClass* A class the class method will be undefined from. | |
471 | + * @param [constchar*] constchar* The name of the class method to be undefined. | |
471 | 472 | */ |
472 | 473 | MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*); |
473 | 474 |
@@ -494,11 +495,11 @@ MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*); | ||
494 | 495 | * obj = mrb_obj_new(mrb, example_class, 0, NULL); # => ExampleClass.new |
495 | 496 | * mrb_p(mrb, obj); // => Kernel#p |
496 | 497 | * } |
497 | - * @param mrb The current mruby state. | |
498 | - * @param c Reference to the class of the new object. | |
499 | - * @param argc Number of arguments in argv | |
500 | - * @param argv Array of mrb_value to initialize the object | |
501 | - * @return The newly initialized object | |
498 | + * @param [mrb_state*] mrb The current mruby state. | |
499 | + * @param [RClass*] c Reference to the class of the new object. | |
500 | + * @param [mrb_int] argc Number of arguments in argv | |
501 | + * @param [const mrb_value *] argv Array of mrb_value to initialize the object | |
502 | + * @return [mrb_value] The newly initialized object | |
502 | 503 | */ |
503 | 504 | MRB_API mrb_value mrb_obj_new(mrb_state *mrb, struct RClass *c, mrb_int argc, const mrb_value *argv); |
504 | 505 |
@@ -525,9 +526,9 @@ MRB_API mrb_value mrb_instance_new(mrb_state *mrb, mrb_value cv); | ||
525 | 526 | * mrb_p(mrb, obj); // => Kernel#p |
526 | 527 | * } |
527 | 528 | * |
528 | - * @param mrb The current mruby state. | |
529 | - * @param super The super class or parent. | |
530 | - * @return RClass* Reference to the new class. | |
529 | + * @param [mrb_state*] mrb The current mruby state. | |
530 | + * @param [struct RClass *] super The super class or parent. | |
531 | + * @return [struct RClass *] Reference to the new class. | |
531 | 532 | */ |
532 | 533 | MRB_API struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super); |
533 | 534 |
@@ -542,8 +543,8 @@ MRB_API struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super); | ||
542 | 543 | * example_module = mrb_module_new(mrb); |
543 | 544 | * } |
544 | 545 | * |
545 | - * @param mrb The current mruby state. | |
546 | - * @return Reference to the new module. | |
546 | + * @param [mrb_state*] mrb The current mruby state. | |
547 | + * @return [struct RClass *] Reference to the new module. | |
547 | 548 | */ |
548 | 549 | MRB_API struct RClass * mrb_module_new(mrb_state *mrb); |
549 | 550 |
@@ -569,43 +570,43 @@ MRB_API struct RClass * mrb_module_new(mrb_state *mrb); | ||
569 | 570 | * } |
570 | 571 | * } |
571 | 572 | * |
572 | - * @param mrb The current mruby state. | |
573 | - * @param *name A string representing the name of the class. | |
574 | - * @return mrb_bool A boolean value. | |
573 | + * @param [mrb_state*] mrb The current mruby state. | |
574 | + * @param [const char *] name A string representing the name of the class. | |
575 | + * @return [mrb_bool] A boolean value. | |
575 | 576 | */ |
576 | 577 | MRB_API mrb_bool mrb_class_defined(mrb_state *mrb, const char *name); |
577 | 578 | |
578 | 579 | /** |
579 | 580 | * Gets a class. |
580 | - * @param mrb The current mruby state. | |
581 | - * @param name The name of the class. | |
582 | - * @return A reference to the class. | |
581 | + * @param [mrb_state*] mrb The current mruby state. | |
582 | + * @param [const char *] name The name of the class. | |
583 | + * @return [struct RClass *] A reference to the class. | |
583 | 584 | */ |
584 | 585 | MRB_API struct RClass * mrb_class_get(mrb_state *mrb, const char *name); |
585 | 586 | |
586 | 587 | /** |
587 | 588 | * Gets a child class. |
588 | - * @param mrb The current mruby state. | |
589 | - * @param outer The name of the parent class. | |
590 | - * @param name The name of the class. | |
591 | - * @return A reference to the class. | |
589 | + * @param [mrb_state*] mrb The current mruby state. | |
590 | + * @param [struct RClass *] outer The name of the parent class. | |
591 | + * @param [const char *] name The name of the class. | |
592 | + * @return [struct RClass *] A reference to the class. | |
592 | 593 | */ |
593 | 594 | MRB_API struct RClass * mrb_class_get_under(mrb_state *mrb, struct RClass *outer, const char *name); |
594 | 595 | |
595 | 596 | /** |
596 | 597 | * Gets a module. |
597 | - * @param mrb The current mruby state. | |
598 | - * @param name The name of the module. | |
599 | - * @return A reference to the module. | |
598 | + * @param [mrb_state*] mrb The current mruby state. | |
599 | + * @param [const char *] name The name of the module. | |
600 | + * @return [struct RClass *] A reference to the module. | |
600 | 601 | */ |
601 | 602 | MRB_API struct RClass * mrb_module_get(mrb_state *mrb, const char *name); |
602 | 603 | |
603 | 604 | /** |
604 | 605 | * Gets a module defined under another module. |
605 | - * @param mrb The current mruby state. | |
606 | - * @param outer The name of the outer module. | |
607 | - * @param name The name of the module. | |
608 | - * @return A reference to the module. | |
606 | + * @param [mrb_state*] mrb The current mruby state. | |
607 | + * @param [struct RClass *] outer The name of the outer module. | |
608 | + * @param [const char *] name The name of the module. | |
609 | + * @return [struct RClass *] A reference to the module. | |
609 | 610 | */ |
610 | 611 | MRB_API struct RClass * mrb_module_get_under(mrb_state *mrb, struct RClass *outer, const char *name); |
611 | 612 | MRB_API mrb_value mrb_notimplement_m(mrb_state*, mrb_value); |
@@ -615,9 +616,9 @@ MRB_API mrb_value mrb_notimplement_m(mrb_state*, mrb_value); | ||
615 | 616 | * |
616 | 617 | * Equivalent to: |
617 | 618 | * Object#dup |
618 | - * @param mrb The current mruby state. | |
619 | - * @param obj Object to be duplicate. | |
620 | - * @return The newly duplicated object. | |
619 | + * @param [mrb_state*] mrb The current mruby state. | |
620 | + * @param [mrb_value] obj Object to be duplicate. | |
621 | + * @return [mrb_value] The newly duplicated object. | |
621 | 622 | */ |
622 | 623 | MRB_API mrb_value mrb_obj_dup(mrb_state *mrb, mrb_value obj); |
623 | 624 | MRB_API mrb_value mrb_check_to_integer(mrb_state *mrb, mrb_value val, const char *method); |
@@ -657,21 +658,21 @@ MRB_API mrb_value mrb_check_to_integer(mrb_state *mrb, mrb_value val, const char | ||
657 | 658 | * } |
658 | 659 | * } |
659 | 660 | * |
660 | - * @param mrb The current mruby state. | |
661 | - * @param c A reference to a class. | |
662 | - * @param mid A symbol referencing a method id. | |
663 | - * @return mrb_bool A boolean value. | |
661 | + * @param [mrb_state*] mrb The current mruby state. | |
662 | + * @param [struct RClass *] c A reference to a class. | |
663 | + * @param [mrb_sym] mid A symbol referencing a method id. | |
664 | + * @return [mrb_bool] A boolean value. | |
664 | 665 | */ |
665 | 666 | MRB_API mrb_bool mrb_obj_respond_to(mrb_state *mrb, struct RClass* c, mrb_sym mid); |
666 | 667 | |
667 | 668 | /** |
668 | 669 | * Defines a new class under a given module |
669 | 670 | * |
670 | - * @param mrb The current mruby state. | |
671 | - * @param outer Reference to the module under which the new class will be defined | |
672 | - * @param name The name of the defined class | |
673 | - * @param super The new class parent | |
674 | - * @return Reference to the newly defined class | |
671 | + * @param [mrb_state*] mrb The current mruby state. | |
672 | + * @param [struct RClass *] outer Reference to the module under which the new class will be defined | |
673 | + * @param [const char *] name The name of the defined class | |
674 | + * @param [struct RClass *] super The new class parent | |
675 | + * @return [struct RClass *] Reference to the newly defined class | |
675 | 676 | * @see mrb_define_class |
676 | 677 | */ |
677 | 678 | MRB_API struct RClass * mrb_define_class_under(mrb_state *mrb, struct RClass *outer, const char *name, struct RClass *super); |