From 66aa184a82aeb51ae5ec73f5b38a2523e31305fe Mon Sep 17 00:00:00 2001 From: dearblue Date: Sat, 21 Aug 2021 15:15:20 +0900 Subject: Checks the frozen object with `mrb_get_args()` This now works with the `+` modifier that can be added after each specifier. - `nil` is bypassed. - The `s` and `z` specifiers are received in C as a `const char *`, so adding a `+` modifier will raise an exception. - The `a` specifier is received in C as `const mrb_value *`, so adding a `+` modifier will raise an exception. - The `|`, `*`, `&`, `?` and `:` specifiers with `+` modifier raises an exception. If `!`/`+` exceeds one for each specifier, an exception will occur in the subsequent processing. This is the same behavior as before. --- include/mruby.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/mruby.h') diff --git a/include/mruby.h b/include/mruby.h index 2a6bc7753..45736ba38 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -911,6 +911,13 @@ MRB_API struct RClass* mrb_define_module_under_id(mrb_state *mrb, struct RClass * | `:` | keyword args | {mrb_kwargs} const | Get keyword arguments. @see mrb_kwargs | * * @see mrb_get_args + * + * Immediately after format specifiers it can add format modifiers: + * + * | char | Notes | + * |:----:|-----------------------------------------------------------------------------------------| + * | `!` | Switch to the alternate mode; The behaviour changes depending on the format specifier | + * | `+` | Request a not frozen object; However, except nil value | */ typedef const char *mrb_args_format; -- cgit v1.2.3