Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)
|
Compile-time static implementation of rb_scan_args(). More...
#include "ruby/assert.h"
#include "ruby/internal/attr/diagnose_if.h"
#include "ruby/internal/attr/error.h"
#include "ruby/internal/attr/forceinline.h"
#include "ruby/internal/attr/nonnull.h"
#include "ruby/internal/attr/noreturn.h"
#include "ruby/internal/config.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/has/attribute.h"
#include "ruby/internal/intern/array.h"
#include "ruby/internal/intern/error.h"
#include "ruby/internal/intern/hash.h"
#include "ruby/internal/intern/proc.h"
#include "ruby/internal/iterator.h"
#include "ruby/internal/static_assert.h"
#include "ruby/internal/stdbool.h"
#include "ruby/internal/value.h"
Go to the source code of this file.
Macros | |
#define | HAVE_RB_SCAN_ARGS_OPTIONAL_HASH 1 |
Possible values that you should pass to rb_scan_args_kw(). | |
#define | RB_SCAN_ARGS_PASS_CALLED_KEYWORDS 0 |
Same behaviour as rb_scan_args(). | |
#define | RB_SCAN_ARGS_KEYWORDS 1 |
The final argument should be a hash treated as keywords. | |
#define | RB_SCAN_ARGS_LAST_HASH_KEYWORDS 3 |
Treat a final argument as keywords if it is a hash, and not as keywords otherwise. | |
Possible values that you should pass to rb_funcallv_kw(). | |
#define | RB_NO_KEYWORDS 0 |
Do not pass keywords. | |
#define | RB_PASS_KEYWORDS 1 |
Pass keywords, final argument should be a hash of keywords. | |
#define | RB_PASS_CALLED_KEYWORDS !!rb_keyword_given_p() |
Pass keywords if current method is called with keywords, useful for argument delegation. |
Functions | |
int | rb_scan_args (int argc, const VALUE *argv, const char *fmt,...) |
Retrieves argument from argc and argv to given VALUE references according to the format string. | |
int | rb_scan_args_kw (int kw_splat, int argc, const VALUE *argv, const char *fmt,...) |
Identical to rb_scan_args(), except it also accepts kw_splat. |
Compile-time static implementation of rb_scan_args().
This is a beast. It statically analyses the argument spec string, and expands the assignment of variables into dedicated codes.
Definition in file scan_args.h.
#define HAVE_RB_SCAN_ARGS_OPTIONAL_HASH 1 |
Definition at line 89 of file scan_args.h.
#define RB_NO_KEYWORDS 0 |
Do not pass keywords.
Definition at line 69 of file scan_args.h.
Referenced by rb_block_call(), rb_call_super(), rb_check_funcall(), rb_class_new_instance(), rb_fiber_resume(), rb_fiber_transfer(), rb_fiber_yield(), rb_method_call_with_block(), rb_mod_module_eval(), rb_mod_module_exec(), rb_obj_call_init(), rb_obj_instance_eval(), rb_obj_instance_exec(), rb_proc_call(), and rb_proc_call_with_block().
#define RB_PASS_CALLED_KEYWORDS !!rb_keyword_given_p() |
Pass keywords if current method is called with keywords, useful for argument delegation.
Definition at line 78 of file scan_args.h.
Referenced by rb_class_new_instance_pass_kw().
#define RB_PASS_KEYWORDS 1 |
Pass keywords, final argument should be a hash of keywords.
Definition at line 72 of file scan_args.h.
#define RB_SCAN_ARGS_KEYWORDS 1 |
The final argument should be a hash treated as keywords.
Definition at line 53 of file scan_args.h.
#define RB_SCAN_ARGS_LAST_HASH_KEYWORDS 3 |
Treat a final argument as keywords if it is a hash, and not as keywords otherwise.
Definition at line 59 of file scan_args.h.
#define RB_SCAN_ARGS_PASS_CALLED_KEYWORDS 0 |
Same behaviour as rb_scan_args().
Definition at line 50 of file scan_args.h.
Referenced by rb_scan_args().