mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Added MRB_API function to get block arguments info.
- ` mrb_block_given_p()` -- The name comes from CRuby's `rb_block_given_p ()` At the same time, it applies to `f_instance_eval()` and `f_class_eval()` of `mruby-eval`.
This commit is contained in:
committed by
Yukihiro "Matz" Matsumoto
parent
43eddfd4d5
commit
c40802865a
@@ -1004,6 +1004,11 @@ MRB_API const mrb_value *mrb_get_argv(mrb_state *mrb);
|
||||
*/
|
||||
MRB_API mrb_value mrb_get_arg1(mrb_state *mrb);
|
||||
|
||||
/**
|
||||
* Check if a block argument is given from mrb_state.
|
||||
*/
|
||||
MRB_API mrb_bool mrb_block_given_p(mrb_state *mrb);
|
||||
|
||||
/* `strlen` for character string literals (use with caution or `strlen` instead)
|
||||
Adjacent string literals are concatenated in C/C++ in translation phase 6.
|
||||
If `lit` is not one, the compiler will report a syntax error:
|
||||
|
||||
Reference in New Issue
Block a user