Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Compile-time static implementation of rb_scan_args(). More...
#include "ruby/internal/attr/diagnose_if.h"
#include "ruby/internal/attr/error.h"
#include "ruby/internal/attr/forceinline.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"
#include "ruby/assert.h"
Go to the source code of this file.
Macros | |
#define | RB_SCAN_ARGS_PASS_CALLED_KEYWORDS 0 |
#define | RB_SCAN_ARGS_KEYWORDS 1 |
#define | RB_SCAN_ARGS_LAST_HASH_KEYWORDS 3 |
#define | RB_NO_KEYWORDS 0 |
#define | RB_PASS_KEYWORDS 1 |
#define | RB_PASS_CALLED_KEYWORDS rb_keyword_given_p() |
#define | HAVE_RB_SCAN_ARGS_OPTIONAL_HASH 1 |
#define | rb_scan_args_isdigit(c) (RBIMPL_CAST((unsigned char)((c)-'0'))<10) |
#define | rb_scan_args_count_end(fmt, ofs, vari) ((fmt)[ofs] ? -1 : (vari)) |
#define | rb_scan_args_count_block(fmt, ofs, vari) |
#define | rb_scan_args_count_hash(fmt, ofs, vari) |
#define | rb_scan_args_count_trail(fmt, ofs, vari) |
#define | rb_scan_args_count_var(fmt, ofs, vari) |
#define | rb_scan_args_count_opt(fmt, ofs, vari) |
#define | rb_scan_args_count_lead(fmt, ofs, vari) |
#define | rb_scan_args_count(fmt) rb_scan_args_count_lead(fmt, 0, 0) |
#define | rb_scan_args_verify(fmt, varc) |
#define | rb_scan_args0(argc, argv, fmt, varc, vars) |
#define | rb_scan_args_kw0(kw_flag, argc, argv, fmt, varc, vars) |
#define | rb_scan_args_next_param() vars[vari++] |
Functions | |
int | rb_scan_args (int, const VALUE *, const char *,...) |
int | rb_scan_args_kw (int, int, const VALUE *, const char *,...) |
void | rb_scan_args_bad_format (const char *) |
void | rb_scan_args_length_mismatch (const char *, int) |
Compile-time static implementation of rb_scan_args().
RBIMPL
or rbimpl
are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will. __VA_ARGS__
is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98. 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 50 of file scan_args.h.
#define RB_NO_KEYWORDS 0 |
Definition at line 46 of file scan_args.h.
#define RB_PASS_CALLED_KEYWORDS rb_keyword_given_p() |
Definition at line 48 of file scan_args.h.
#define RB_PASS_KEYWORDS 1 |
Definition at line 47 of file scan_args.h.
Definition at line 239 of file scan_args.h.
#define rb_scan_args_count | ( | fmt | ) | rb_scan_args_count_lead(fmt, 0, 0) |
Definition at line 102 of file scan_args.h.
#define rb_scan_args_count_block | ( | fmt, | |
ofs, | |||
vari | |||
) |
Definition at line 72 of file scan_args.h.
#define rb_scan_args_count_end | ( | fmt, | |
ofs, | |||
vari | |||
) | ((fmt)[ofs] ? -1 : (vari)) |
Definition at line 69 of file scan_args.h.
#define rb_scan_args_count_hash | ( | fmt, | |
ofs, | |||
vari | |||
) |
Definition at line 77 of file scan_args.h.
#define rb_scan_args_count_lead | ( | fmt, | |
ofs, | |||
vari | |||
) |
Definition at line 97 of file scan_args.h.
#define rb_scan_args_count_opt | ( | fmt, | |
ofs, | |||
vari | |||
) |
Definition at line 92 of file scan_args.h.
#define rb_scan_args_count_trail | ( | fmt, | |
ofs, | |||
vari | |||
) |
Definition at line 82 of file scan_args.h.
#define rb_scan_args_count_var | ( | fmt, | |
ofs, | |||
vari | |||
) |
Definition at line 87 of file scan_args.h.
#define rb_scan_args_isdigit | ( | c | ) | (RBIMPL_CAST((unsigned char)((c)-'0'))<10) |
Definition at line 67 of file scan_args.h.
#define RB_SCAN_ARGS_KEYWORDS 1 |
Definition at line 44 of file scan_args.h.
Definition at line 248 of file scan_args.h.
#define RB_SCAN_ARGS_LAST_HASH_KEYWORDS 3 |
Definition at line 45 of file scan_args.h.
#define rb_scan_args_next_param | ( | ) | vars[vari++] |
#define RB_SCAN_ARGS_PASS_CALLED_KEYWORDS 0 |
Definition at line 43 of file scan_args.h.
#define rb_scan_args_verify | ( | fmt, | |
varc | |||
) |
Definition at line 116 of file scan_args.h.
void rb_scan_args_bad_format | ( | const char * | ) |