Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "internal.h"
#include "ruby/re.h"
#include "ruby/util.h"
#include "regint.h"
#include "encindex.h"
#include <ctype.h>
Go to the source code of this file.
Data Structures | |
struct | pair_t |
struct | backref_name_tag |
Macros | |
#define | errcpy(err, msg) strlcpy((err), (msg), ONIG_MAX_ERROR_MESSAGE_LEN) |
#define | BEG(no) (regs->beg[(no)]) |
#define | END(no) (regs->end[(no)]) |
#define | REG_LITERAL FL_USER5 |
#define | REG_ENCODING_NONE FL_USER6 |
#define | KCODE_FIXED FL_USER4 |
#define | ARG_REG_OPTION_MASK (ONIG_OPTION_IGNORECASE|ONIG_OPTION_MULTILINE|ONIG_OPTION_EXTEND) |
#define | ARG_ENCODING_FIXED 16 |
#define | ARG_ENCODING_NONE 32 |
#define | MATCH_BUSY FL_USER2 |
#define | NAME_TO_NUMBER(regs, re, name, name_ptr, name_end) |
#define | ASCGET(s, e, cl) (acompat ? (*(cl)=1,ISASCII((s)[0])?(s)[0]:-1) : rb_enc_ascget((s), (e), (cl), str_enc)) |
Typedefs | |
typedef char | onig_errmsg_buffer[ONIG_MAX_ERROR_MESSAGE_LEN] |
Variables | |
VALUE | rb_eRegexpError |
VALUE | rb_cMatch |
VALUE | rb_cRegexp |
static VALUE | reg_cache |
#define ARG_ENCODING_FIXED 16 |
Definition at line 295 of file re.c.
Referenced by Init_Regexp(), rb_char_to_option_kcode(), rb_reg_initialize(), and rb_reg_options().
#define ARG_ENCODING_NONE 32 |
Definition at line 296 of file re.c.
Referenced by Init_Regexp(), rb_char_to_option_kcode(), rb_reg_initialize(), rb_reg_initialize_m(), rb_reg_initialize_str(), rb_reg_options(), and rb_reg_preprocess_dregexp().
#define ARG_REG_OPTION_MASK (ONIG_OPTION_IGNORECASE|ONIG_OPTION_MULTILINE|ONIG_OPTION_EXTEND) |
Definition at line 293 of file re.c.
Referenced by rb_reg_initialize(), and rb_reg_options().
#define ASCGET | ( | s, | |
e, | |||
cl | |||
) | (acompat ? (*(cl)=1,ISASCII((s)[0])?(s)[0]:-1) : rb_enc_ascget((s), (e), (cl), str_enc)) |
Referenced by rb_reg_regsub().
#define BEG | ( | no | ) | (regs->beg[(no)]) |
Definition at line 24 of file re.c.
Referenced by match_begin(), match_end(), match_offset(), rb_match_nth_defined(), rb_reg_match_last(), rb_reg_match_post(), rb_reg_match_pre(), rb_reg_nth_defined(), rb_reg_nth_match(), rb_reg_regsub(), and update_char_offset().
#define END | ( | no | ) | (regs->end[(no)]) |
Definition at line 25 of file re.c.
Referenced by rb_reg_match_post(), rb_reg_nth_match(), rb_reg_regsub(), and update_char_offset().
Definition at line 22 of file re.c.
Referenced by append_utf8(), check_unicode_range(), rb_reg_initialize(), rb_reg_initialize_str(), read_escaped_byte(), unescape_escaped_nonascii(), unescape_nonascii(), unescape_unicode_bmp(), and unescape_unicode_list().
#define KCODE_FIXED FL_USER4 |
Definition at line 291 of file re.c.
Referenced by rb_reg_equal(), rb_reg_fixed_encoding_p(), rb_reg_initialize(), and rb_reg_options().
#define MATCH_BUSY FL_USER2 |
Definition at line 1257 of file re.c.
Referenced by rb_backref_set_string(), rb_match_busy(), and rb_reg_search0().
#define NAME_TO_NUMBER | ( | regs, | |
re, | |||
name, | |||
name_ptr, | |||
name_end | |||
) |
Definition at line 1829 of file re.c.
Referenced by namev_to_backref_number(), and rb_reg_regsub().
#define REG_ENCODING_NONE FL_USER6 |
Definition at line 289 of file re.c.
Referenced by rb_reg_desc(), rb_reg_initialize(), rb_reg_options(), and rb_reg_prepare_enc().
#define REG_LITERAL FL_USER5 |
Definition at line 288 of file re.c.
Referenced by rb_reg_compile(), and rb_reg_initialize().
typedef char onig_errmsg_buffer[ONIG_MAX_ERROR_MESSAGE_LEN] |
|
static |
Definition at line 2372 of file re.c.
References check_unicode_range(), errcpy, len, rb_str_buf_cat(), rb_utf8_encoding(), rb_uv_to_utf8(), and snprintf.
Referenced by unescape_unicode_bmp(), and unescape_unicode_list().
|
static |
Definition at line 299 of file re.c.
References ONIG_OPTION_EXTEND, ONIG_OPTION_IGNORECASE, ONIG_OPTION_MULTILINE, and val.
Referenced by rb_char_to_option_kcode(), and rb_reg_to_s().
|
static |
|
static |
Definition at line 3806 of file re.c.
References Qfalse, and rb_warn().
Referenced by Init_Regexp().
void Init_Regexp | ( | void | ) |
Definition at line 3910 of file re.c.
References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, CLASS_OF, ignorecase_getter(), ignorecase_setter(), INT2FIX, kcode_getter(), kcode_setter(), last_match_getter(), last_paren_match_getter(), match_alloc(), match_aref(), match_begin(), match_captures(), match_end(), match_equal(), match_getter(), match_hash(), match_init_copy(), match_inspect(), match_named_captures(), match_names(), match_offset(), match_regexp(), match_setter(), match_size(), match_string(), match_to_a(), match_to_s(), match_values_at(), ONIG_ENCODING_ASCII, ONIG_OPTION_EXTEND, ONIG_OPTION_IGNORECASE, ONIG_OPTION_MULTILINE, onig_set_verb_warn_func(), onig_set_warn_func(), onigenc_set_default_encoding(), postmatch_getter(), prematch_getter(), rb_class_new_instance(), rb_cMatch, rb_cObject, rb_cRegexp, rb_define_alloc_func(), rb_define_class(), rb_define_const(), rb_define_method(), rb_define_singleton_method(), rb_define_virtual_variable(), rb_eRegexpError, rb_eStandardError, rb_global_variable(), rb_obj_encoding(), rb_reg_casefold_p(), rb_reg_eqq(), rb_reg_equal(), rb_reg_fixed_encoding_p(), rb_reg_hash(), rb_reg_init_copy(), rb_reg_initialize_m(), rb_reg_inspect(), rb_reg_match(), rb_reg_match2(), rb_reg_match_m(), rb_reg_match_m_p(), rb_reg_match_post(), rb_reg_match_pre(), rb_reg_named_captures(), rb_reg_names(), rb_reg_options_m(), rb_reg_s_alloc(), rb_reg_s_last_match(), rb_reg_s_quote(), rb_reg_s_try_convert(), rb_reg_s_union_m(), rb_reg_source(), rb_reg_to_s(), rb_undef_method(), re_warn(), and reg_cache.
|
static |
|
static |
Definition at line 1716 of file re.c.
References rb_backref_get(), and rb_reg_last_match().
Referenced by Init_Regexp().
|
static |
Definition at line 1734 of file re.c.
References rb_backref_get(), and rb_reg_match_last().
Referenced by Init_Regexp().
|
static |
Definition at line 860 of file re.c.
References onig_error_code_to_str(), onig_new_with_source(), OnigDefaultSyntax, and UChar.
Referenced by rb_reg_initialize().
Definition at line 899 of file re.c.
References match(), NEWOBJ_OF, T_MATCH, and ZALLOC.
Referenced by Init_Regexp(), rb_backref_set_string(), and rb_reg_search0().
Definition at line 1917 of file re.c.
References re_registers::beg, FIX2INT, FIXNUM_P, len, match_ary_aref(), match_ary_subseq(), match_check(), namev_to_backref_number(), NIL_P, NUM2LONG, re_registers::num_regs, Qnil, rb_reg_nth_match(), rb_scan_args(), RMATCH, and RMATCH_REGS.
Referenced by Init_Regexp().
Definition at line 1740 of file re.c.
References re_registers::beg, re_registers::end, match_check(), re_registers::num_regs, OBJ_TAINT, OBJ_TAINTED, Qnil, rb_ary_new2, rb_ary_push(), rb_str_subseq(), RMATCH, and RMATCH_REGS.
Referenced by match_captures(), and match_to_a().
Definition at line 1871 of file re.c.
References re_registers::beg, len, match_ary_subseq(), NIL_P, NUM2INT, re_registers::num_regs, Qfalse, Qnil, rb_ary_push(), rb_range_beg_len(), rb_reg_nth_match(), result, and RMATCH_REGS.
Referenced by match_aref(), and match_values_at().
Definition at line 1854 of file re.c.
References re_registers::end, len, NIL_P, RARRAY_LEN, rb_ary_new_capa(), rb_ary_push(), rb_ary_resize(), rb_reg_nth_match(), result, and RMATCH_REGS.
Referenced by match_aref(), and match_ary_aref().
Definition at line 1119 of file re.c.
References match_check(), name, name_to_backref_number(), NUM2INT, rb_eIndexError, rb_raise(), rb_sym2str, RB_TYPE_P, RMATCH, RMATCH_REGS, StringValueCStr, strlen(), SYMBOL_P, and T_STRING.
Referenced by match_begin(), match_end(), match_offset(), rb_reg_backref_number(), and rb_reg_s_last_match().
Definition at line 1206 of file re.c.
References BEG, rmatch_offset::beg, rmatch::char_offset, INT2FIX, match_backref_number(), match_check(), re_registers::num_regs, Qnil, rb_eIndexError, rb_raise(), RMATCH, RMATCH_REGS, and update_char_offset().
Referenced by Init_Regexp().
|
static |
Definition at line 1010 of file re.c.
References rb_eTypeError, rb_raise(), and RMATCH.
Referenced by match_aref(), match_array(), match_backref_number(), match_begin(), match_end(), match_hash(), match_named_captures(), match_names(), match_offset(), match_regexp(), match_size(), match_string(), match_to_s(), match_values_at(), rb_reg_match_last(), rb_reg_match_post(), rb_reg_match_pre(), rb_reg_nth_defined(), and rb_reg_nth_match().
Definition at line 1241 of file re.c.
References BEG, rmatch::char_offset, rmatch_offset::end, INT2FIX, match_backref_number(), match_check(), re_registers::num_regs, Qnil, rb_eIndexError, rb_raise(), RMATCH, RMATCH_REGS, and update_char_offset().
Referenced by Init_Regexp().
Definition at line 2974 of file re.c.
References re_registers::beg, re_registers::end, match_regexp(), memcmp(), re_registers::num_regs, Qfalse, Qtrue, rb_reg_equal(), rb_str_equal(), RB_TYPE_P, RMATCH, RMATCH_REGS, and T_MATCH.
Referenced by Init_Regexp().
|
static |
Definition at line 3819 of file re.c.
References match(), NIL_P, Qnil, rb_backref_get(), and rb_match_busy().
Referenced by Init_Regexp(), and rb_reg_s_last_match().
Definition at line 2948 of file re.c.
References re_registers::beg, re_registers::end, match_check(), match_regexp(), re_registers::num_regs, rb_hash_end(), rb_hash_start(), rb_hash_uint(), rb_memhash(), rb_str_hash(), reg_hash(), RMATCH, RMATCH_REGS, and ST2FIX.
Referenced by Init_Regexp().
Definition at line 1019 of file re.c.
References rmatch::char_offset, rmatch::char_offset_num_allocated, rmatch::char_offset_updated, MEMCPY, re_registers::num_regs, OBJ_INIT_COPY, RB_GC_GUARD, rb_memerror(), rb_reg_region_copy(), REALLOC_N, rmatch::regs, RMATCH, and RMATCH_REGS.
Referenced by Init_Regexp().
Definition at line 2151 of file re.c.
References ALLOCA_N, len, match_inspect_name_iter(), MEMZERO, name, names, NIL_P, re_registers::num_regs, onig_foreach_name(), PRIsVALUE, Qnil, rb_class_path(), rb_obj_class(), rb_reg_nth_match(), rb_sprintf(), rb_str_append(), rb_str_buf_append(), rb_str_buf_cat(), rb_str_buf_cat2(), rb_str_buf_new2(), rb_str_catf(), rb_str_inspect(), RMATCH, RMATCH_REGS, and RREGEXP_PTR.
Referenced by Init_Regexp().
|
static |
Definition at line 2117 of file re.c.
References backref_name_tag::len, name, and backref_name_tag::name.
Referenced by match_inspect().
Definition at line 2077 of file re.c.
References hash(), match_check(), match_named_captures_iter(), MEMO_NEW, NIL_P, onig_foreach_name(), rb_hash_new(), RMATCH, and RREGEXP.
Referenced by Init_Regexp().
|
static |
Definition at line 2026 of file re.c.
References re_pattern_buffer::enc, hash(), key, match(), MEMO_CAST, Qnil, rb_enc_str_new(), rb_hash_aset(), rb_reg_nth_match(), RTEST, MEMO::v1, MEMO::v2, and MEMO::value.
Referenced by match_named_captures().
Definition at line 1089 of file re.c.
References match_check(), NIL_P, rb_ary_new_capa(), rb_reg_names(), and RMATCH.
Referenced by Init_Regexp().
Definition at line 1170 of file re.c.
References BEG, rmatch_offset::beg, rmatch::char_offset, rmatch_offset::end, INT2FIX, match_backref_number(), match_check(), re_registers::num_regs, Qnil, rb_assoc_new(), rb_eIndexError, rb_raise(), RMATCH, RMATCH_REGS, and update_char_offset().
Referenced by Init_Regexp().
Definition at line 1061 of file re.c.
References match_check(), NIL_P, rb_reg_nth_match(), rb_reg_quote(), rb_reg_regcomp(), and RMATCH.
Referenced by Init_Regexp(), match_equal(), and match_hash().
Definition at line 1293 of file re.c.
References re_registers::beg, rmatch::char_offset_updated, re_registers::end, len, match(), OBJ_INFECT, onig_region_resize(), Qnil, RMatch::regexp, rmatch::regs, RMatch::rmatch, and RMatch::str.
Referenced by rb_backref_set_string().
|
static |
Definition at line 3829 of file re.c.
References Check_Type, NIL_P, rb_backref_set(), and T_MATCH.
Referenced by Init_Regexp().
Definition at line 1110 of file re.c.
References INT2FIX, match_check(), name_to_backref_number(), and RMATCH_REGS.
Referenced by Init_Regexp().
Definition at line 2105 of file re.c.
References match_check(), and RMATCH.
Referenced by cParser_initialize(), Init_Regexp(), and JSON_parse_string().
Definition at line 2014 of file re.c.
References match_check(), NIL_P, OBJ_TAINT, OBJ_TAINTED, rb_reg_last_match(), rb_str_new(), and RMATCH.
Referenced by Init_Regexp().
Definition at line 1977 of file re.c.
References argc, FIX2INT, FIXNUM_P, match_ary_aref(), match_check(), namev_to_backref_number(), rb_ary_new2, rb_ary_push(), rb_reg_nth_match(), result, RMATCH, and RMATCH_REGS.
Referenced by Init_Regexp().
|
static |
Definition at line 1823 of file re.c.
References PRIsVALUE, rb_eIndexError, and rb_raise().
Referenced by name_to_backref_number(), namev_to_backref_number(), and rb_reg_regsub().
|
static |
Definition at line 1815 of file re.c.
References name, name_to_backref_error(), NORETURN(), onig_name_to_backref_number(), and RREGEXP_PTR.
Referenced by match_backref_number(), and match_size().
|
static |
Definition at line 1835 of file re.c.
References name_to_backref_error(), NAME_TO_NUMBER, rb_sym2str, RB_TYPE_P, RSTRING_END, RSTRING_PTR, SYMBOL_P, and T_STRING.
Referenced by match_aref(), and match_values_at().
NORETURN | ( | static void | name_to_backref_errorVALUE name | ) |
Referenced by name_to_backref_number().
|
static |
Definition at line 838 of file re.c.
References err, IS_NULL, malloc, NULL, onig_compile_ruby(), onig_free(), onig_reg_init(), ONIGENC_CASE_FOLD_DEFAULT, and ONIGERR_MEMORY.
Referenced by make_regexp().
|
static |
Definition at line 321 of file re.c.
References ONIG_OPTION_EXTEND, ONIG_OPTION_IGNORECASE, and ONIG_OPTION_MULTILINE.
Referenced by rb_enc_reg_error_desc(), rb_reg_desc(), and rb_reg_to_s().
|
static |
Definition at line 1728 of file re.c.
References rb_backref_get(), and rb_reg_match_post().
Referenced by Init_Regexp().
|
static |
Definition at line 1722 of file re.c.
References rb_backref_get(), and rb_reg_match_pre().
Referenced by Init_Regexp().
void rb_backref_set_string | ( | VALUE | string, |
long | pos, | ||
long | len | ||
) |
Definition at line 1308 of file re.c.
References FL_TEST, match(), match_alloc(), MATCH_BUSY, match_set_string(), NIL_P, rb_backref_get(), rb_backref_set(), and rb_cMatch.
Referenced by rb_pat_search().
int rb_char_to_option_kcode | ( | int | c, |
int * | option, | ||
int * | kcode | ||
) |
Definition at line 332 of file re.c.
References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, char_to_option(), ENCINDEX_EUC_JP, ENCINDEX_Windows_31J, rb_ascii8bit_encindex(), and rb_utf8_encindex().
Referenced by parser_regx_options(), and rb_reg_fragment_setenc().
Definition at line 3486 of file re.c.
References rb_check_convert_type(), and T_REGEXP.
Referenced by rb_reg_s_try_convert(), and rb_reg_s_union().
|
static |
Definition at line 669 of file re.c.
References NULL, option_to_str(), rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_associate(), rb_eRegexpError, rb_exc_new3, rb_reg_expr_str(), rb_str_buf_cat2(), and rb_str_buf_new2().
Referenced by rb_enc_reg_raise(), and rb_reg_error_desc().
VALUE rb_enc_reg_new | ( | const char * | s, |
long | len, | ||
rb_encoding * | enc, | ||
int | options | ||
) |
Definition at line 2830 of file re.c.
References err, NULL, rb_enc_reg_raise(), rb_enc_str_new(), rb_fstring(), RB_OBJ_WRITE, rb_reg_alloc(), rb_reg_initialize(), RREGEXP, and RRegexp::src.
Referenced by rb_reg_new().
|
static |
Definition at line 686 of file re.c.
References rb_enc_reg_error_desc(), and rb_exc_raise().
Referenced by rb_enc_reg_new().
void rb_match_busy | ( | VALUE | match | ) |
Definition at line 1260 of file re.c.
References FL_SET, and MATCH_BUSY.
Referenced by date__httpdate(), date__iso8601(), date__jisx0301(), date__parse(), date__rfc2822(), date__rfc3339(), date__strptime_internal(), date__xmlschema(), match_getter(), nucomp_s_convert(), nurat_s_convert(), and rb_reg_match_m().
int rb_match_count | ( | VALUE | match | ) |
Definition at line 1266 of file re.c.
References NIL_P, re_registers::num_regs, and RMATCH_REGS.
Referenced by rb_f_global_variables().
int rb_match_nth_defined | ( | int | nth, |
VALUE | match | ||
) |
Definition at line 1276 of file re.c.
References BEG, FALSE, NIL_P, re_registers::num_regs, and RMATCH_REGS.
Referenced by rb_f_global_variables().
Definition at line 79 of file re.c.
Referenced by parser_encode_length(), and rb_num_get_rounding_option().
Definition at line 94 of file re.c.
References memcmp(), and rb_memsearch_ss().
long rb_memsearch | ( | const void * | x0, |
long | m, | ||
const void * | y0, | ||
long | n, | ||
rb_encoding * | enc | ||
) |
Definition at line 252 of file re.c.
References LIKELY, memcmp(), rb_enc_mbminlen, rb_memsearch_qchar(), rb_memsearch_qs(), rb_memsearch_qs_utf8(), rb_memsearch_ss(), rb_memsearch_wchar(), rb_utf8_encoding(), and SIZEOF_VALUE.
Referenced by rb_str_enumerate_lines(), rb_str_split_m(), and rb_strseq_index().
|
inlinestatic |
Definition at line 239 of file re.c.
References char_size, and memcmp().
Referenced by rb_memsearch().
|
inlinestatic |
Definition at line 204 of file re.c.
References memcmp(), and rb_memsearch_qs_utf8_hash().
Referenced by rb_memsearch().
|
inlinestatic |
Definition at line 172 of file re.c.
Referenced by rb_memsearch_qs_utf8().
|
inlinestatic |
Definition at line 112 of file re.c.
References CHAR_BIT, rb_bug(), and SIZEOF_VALUE.
Referenced by rb_memcmp(), and rb_memsearch().
|
inlinestatic |
Definition at line 226 of file re.c.
References char_size, and memcmp().
Referenced by rb_memsearch().
Definition at line 1465 of file re.c.
References onigenc_get_right_adjust_char_head(), ONIGENC_LEFT_ADJUST_CHAR_HEAD, ONIGENC_MBC_MAXLEN, range, rb_reg_prepare_enc(), RSTRING_LEN, RSTRING_PTR, and UChar.
VALUE rb_reg_alloc | ( | void | ) |
Definition at line 2786 of file re.c.
References rb_cRegexp, and rb_reg_s_alloc().
Referenced by rb_enc_reg_new(), rb_reg_compile(), and rb_reg_new_str().
Definition at line 1146 of file re.c.
References match_backref_number().
Referenced by rb_str_subpat(), and rb_str_subpat_set().
Definition at line 717 of file re.c.
References ONIG_OPTION_IGNORECASE, options(), Qfalse, Qtrue, rb_reg_check(), and RREGEXP_PTR.
Referenced by Init_Regexp().
|
static |
Definition at line 358 of file re.c.
References rb_eTypeError, rb_raise(), RREGEXP_PTR, RREGEXP_SRC, and RREGEXP_SRC_PTR.
Referenced by rb_reg_casefold_p(), rb_reg_desc(), rb_reg_equal(), rb_reg_init_copy(), rb_reg_initialize_m(), rb_reg_named_captures(), rb_reg_names(), rb_reg_options(), rb_reg_prepare_enc(), rb_reg_prepare_re0(), rb_reg_source(), rb_reg_to_s(), and reg_hash().
Definition at line 2603 of file re.c.
References buf, err, Qnil, rb_enc_get(), RB_GC_GUARD, rb_reg_error_desc(), rb_reg_preprocess(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by get_pat_quoted(), and reg_fragment_check_gen().
Definition at line 2850 of file re.c.
References err, FL_SET, Qnil, rb_reg_alloc(), rb_reg_error_desc(), rb_reg_initialize_str(), rb_set_errinfo(), rb_str_new(), and REG_LITERAL.
Referenced by ibf_load_object_regexp(), and rb_parser_reg_compile().
Definition at line 455 of file re.c.
References NULL, OBJ_INFECT, option_to_str(), options(), rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_copy(), rb_enc_get(), rb_reg_check(), rb_reg_expr_str(), rb_str_buf_cat2(), rb_str_buf_new2(), rb_usascii_encoding(), RBASIC, REG_ENCODING_NONE, and RREGEXP_PTR.
Referenced by rb_reg_inspect(), and rb_reg_raise().
Definition at line 3104 of file re.c.
References FALSE, NIL_P, Qfalse, Qnil, Qtrue, rb_backref_set(), rb_reg_search(), and reg_operand().
Referenced by Init_Regexp().
Definition at line 2922 of file re.c.
References ENCODING_GET, FL_TEST, KCODE_FIXED, memcmp(), options(), Qfalse, Qtrue, rb_reg_check(), RB_TYPE_P, RREGEXP_PTR, RREGEXP_SRC_LEN, RREGEXP_SRC_PTR, and T_REGEXP.
Referenced by Init_Regexp(), and match_equal().
Definition at line 692 of file re.c.
References rb_enc_get(), rb_enc_reg_error_desc(), RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_reg_check_preprocess(), rb_reg_compile(), and rb_reg_raise_str().
|
static |
Definition at line 366 of file re.c.
References ENC_CODERANGE_CLEAN_P, ENC_CODERANGE_UNKNOWN, len, mbclen, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, rb_enc_ascget(), rb_enc_asciicompat, rb_enc_isprint, rb_enc_isspace, rb_enc_mbc_to_codepoint, rb_enc_precise_mbclen(), rb_enc_unicode_p(), rb_str_buf_cat(), rb_str_buf_cat_escaped_char(), rb_str_coderange_scan_restartable(), and snprintf.
Referenced by rb_enc_reg_error_desc(), rb_reg_desc(), and rb_reg_to_s().
Definition at line 1348 of file re.c.
References err, FL_TEST, KCODE_FIXED, Qfalse, Qtrue, and rb_reg_preprocess().
Referenced by Init_Regexp(), rb_reg_prepare_enc(), and rb_reg_s_union().
Definition at line 2888 of file re.c.
References reg_hash(), and ST2FIX.
Referenced by Init_Regexp().
Definition at line 3662 of file re.c.
References OBJ_INIT_COPY, rb_reg_check(), rb_reg_init_str(), rb_reg_options(), and RREGEXP_SRC.
Referenced by Init_Regexp().
Definition at line 2798 of file re.c.
References err, NULL, rb_reg_initialize_str(), and rb_reg_raise_str().
Referenced by rb_reg_init_copy(), rb_reg_initialize_m(), and rb_reg_new_str().
|
static |
Definition at line 2810 of file re.c.
References err, NULL, rb_reg_initialize(), rb_reg_raise_str(), reg_set_source(), RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_reg_initialize_m().
|
static |
Definition at line 2684 of file re.c.
References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, ARG_REG_OPTION_MASK, errcpy, FL_TEST, KCODE_FIXED, make_regexp(), RRegexp::ptr, Qnil, rb_ascii8bit_encoding(), rb_check_frozen, rb_enc_associate(), rb_enc_dummy_p(), rb_eSecurityError, rb_eTypeError, RB_GC_GUARD, rb_raise(), rb_reg_preprocess(), rb_usascii_encoding(), REG_ENCODING_NONE, REG_LITERAL, RREGEXP, RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_enc_reg_new(), rb_reg_init_str_enc(), and rb_reg_initialize_str().
Definition at line 3314 of file re.c.
References ARG_ENCODING_NONE, FIX2INT, FIXNUM_P, NIL_P, ONIG_OPTION_IGNORECASE, rb_ascii8bit_encoding(), rb_check_arity, rb_enc_get(), rb_reg_check(), rb_reg_init_str(), rb_reg_init_str_enc(), rb_reg_options(), RB_TYPE_P, rb_warn(), RREGEXP_SRC, RTEST, StringValue, StringValuePtr, and T_REGEXP.
Referenced by Init_Regexp().
|
static |
Definition at line 2751 of file re.c.
References ARG_ENCODING_NONE, ENC_CODERANGE_7BIT, errcpy, OBJ_INFECT, rb_ascii8bit_encoding(), rb_enc_get(), rb_reg_initialize(), reg_set_source(), RSTRING_LEN, RSTRING_PTR, and str_coderange().
Referenced by rb_reg_compile(), and rb_reg_init_str().
Definition at line 521 of file re.c.
References rb_any_to_s(), rb_reg_desc(), RREGEXP_PTR, RREGEXP_SRC, RREGEXP_SRC_LEN, and RREGEXP_SRC_PTR.
Referenced by Init_Regexp().
Definition at line 1636 of file re.c.
References rb_reg_nth_match().
Referenced by last_match_getter(), match_to_s(), and vm_getspecial().
Definition at line 3074 of file re.c.
References LONG2FIX, Qnil, rb_str_sublen(), and reg_match_pos().
Referenced by Init_Regexp(), and rb_str_match().
Definition at line 3133 of file re.c.
References LONG2FIX, Qnil, rb_backref_set(), rb_lastline_get(), rb_reg_search(), rb_str_sublen(), RB_TYPE_P, and T_STRING.
Referenced by Init_Regexp().
Definition at line 1699 of file re.c.
References BEG, match_check(), NIL_P, re_registers::num_regs, Qnil, rb_reg_nth_match(), and RMATCH_REGS.
Referenced by last_paren_match_getter(), and vm_getspecial().
Definition at line 3185 of file re.c.
References NIL_P, NUM2LONG, Qnil, rb_backref_get(), rb_backref_set(), rb_block_given_p(), rb_match_busy(), rb_scan_args(), rb_yield(), reg_match_pos(), and result.
Referenced by Init_Regexp().
Definition at line 3227 of file re.c.
References NUM2LONG, rb_check_arity, and rb_reg_match_p().
Referenced by Init_Regexp().
Definition at line 3234 of file re.c.
References re_registers::beg, re_registers::end, err, len, NIL_P, NULL, NUM2LONG, onig_error_code_to_str(), onig_free(), ONIG_MISMATCH, ONIG_OPTION_NONE, onig_search(), Qfalse, Qtrue, rb_reg_prepare_re0(), rb_reg_raise(), rb_str_length(), rb_str_subpos(), rb_sym2str, result, RREGEXP, RREGEXP_PTR, RREGEXP_SRC_LEN, RREGEXP_SRC_PTR, RSTRING_LEN, RSTRING_PTR, StringValue, SYMBOL_P, and UChar.
Referenced by rb_reg_match_m_p(), and rb_str_match_m_p().
Definition at line 1681 of file re.c.
References BEG, END, match_check(), NIL_P, OBJ_TAINT, OBJ_TAINTED, Qnil, rb_str_subseq(), RMATCH, RMATCH_REGS, and RSTRING_LEN.
Referenced by Init_Regexp(), postmatch_getter(), and vm_getspecial().
Definition at line 1654 of file re.c.
References BEG, match_check(), NIL_P, OBJ_TAINT, OBJ_TAINTED, Qnil, rb_str_subseq(), RMATCH, and RMATCH_REGS.
Referenced by Init_Regexp(), prematch_getter(), and vm_getspecial().
Definition at line 829 of file re.c.
References hash(), onig_foreach_name(), rb_hash_new(), rb_reg_check(), reg_named_captures_iter(), and RREGEXP_PTR.
Referenced by Init_Regexp().
Definition at line 781 of file re.c.
References onig_foreach_name(), onig_number_of_names(), rb_ary_new_capa(), rb_reg_check(), reg_names_iter(), and RREGEXP_PTR.
Referenced by Init_Regexp(), and match_names().
Definition at line 2844 of file re.c.
References rb_ascii8bit_encoding(), and rb_enc_reg_new().
Referenced by date__strptime_internal(), proc_options(), and regcomp().
Definition at line 2824 of file re.c.
References rb_reg_new_str(), and rb_reg_preprocess_dregexp().
Definition at line 2792 of file re.c.
References rb_reg_alloc(), and rb_reg_init_str().
Referenced by r_object0(), rb_reg_new_ary(), rb_reg_regcomp(), and rb_reg_s_union().
Definition at line 1592 of file re.c.
References BEG, match_check(), NIL_P, re_registers::num_regs, Qfalse, Qnil, Qtrue, and RMATCH_REGS.
Definition at line 1610 of file re.c.
References BEG, END, re_registers::end, len, match_check(), NIL_P, re_registers::num_regs, OBJ_INFECT, Qnil, rb_str_subseq(), RMATCH, and RMATCH_REGS.
Referenced by date__strptime_internal(), httpdate_type1_cb(), httpdate_type2_cb(), httpdate_type3_cb(), iso8601_bas_datetime_cb(), iso8601_ext_datetime_cb(), iso8601_ext_time_cb(), jisx0301_cb(), match_aref(), match_ary_aref(), match_ary_subseq(), match_inspect(), match_named_captures_iter(), match_regexp(), match_values_at(), parse_day_cb(), parse_ddd_cb(), parse_dot(), parse_dot_cb(), parse_eu_cb(), parse_frag_cb(), parse_iso21_cb(), parse_iso22_cb(), parse_iso23_cb(), parse_iso24_cb(), parse_iso25_cb(), parse_iso26_cb(), parse_iso_cb(), parse_jis_cb(), parse_mday_cb(), parse_mon_cb(), parse_sla(), parse_sla_cb(), parse_time(), parse_time2_cb(), parse_time_cb(), parse_us_cb(), parse_vms11_cb(), parse_vms12_cb(), parse_year_cb(), rb_reg_last_match(), rb_reg_match_last(), rb_reg_s_last_match(), rb_str_rpartition(), rb_str_sub_bang(), rb_str_subpat(), rfc2822_cb(), rfc3339_cb(), scan_once(), str_gsub(), vm_getspecial(), xmlschema_datetime_cb(), xmlschema_time_cb(), and xmlschema_trunc_cb().
int rb_reg_options | ( | VALUE | re | ) |
Definition at line 3474 of file re.c.
References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, ARG_REG_OPTION_MASK, KCODE_FIXED, options(), rb_reg_check(), RBASIC, REG_ENCODING_NONE, and RREGEXP_PTR.
Referenced by ibf_dump_object_regexp(), rb_reg_init_copy(), rb_reg_initialize_m(), rb_reg_options_m(), and w_object().
Definition at line 749 of file re.c.
References INT2NUM, options(), and rb_reg_options().
Referenced by Init_Regexp().
|
static |
Definition at line 1381 of file re.c.
References ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, rb_ascii8bit_encoding(), rb_eArgError, rb_enc_asciicompat, rb_enc_get(), rb_enc_name, rb_raise(), rb_reg_check(), rb_reg_fixed_encoding_p(), rb_usascii_encoding(), rb_warn(), RBASIC, reg_enc_error(), REG_ENCODING_NONE, RREGEXP_PTR, and str_coderange().
Referenced by rb_reg_adjust_startpos(), and rb_reg_prepare_re0().
Definition at line 1458 of file re.c.
References err, and rb_reg_prepare_re0().
Referenced by strscan_do_scan().
regex_t* rb_reg_prepare_re0 | ( | VALUE | re, |
VALUE | str, | ||
onig_errmsg_buffer | err | ||
) |
Definition at line 1420 of file re.c.
References re_pattern_buffer::enc, onig_error_code_to_str(), onig_new(), OnigDefaultSyntax, re_pattern_buffer::options, Qnil, rb_eArgError, RB_GC_GUARD, rb_raise(), rb_reg_check(), rb_reg_prepare_enc(), rb_reg_preprocess(), rb_reg_raise(), RREGEXP_PTR, RREGEXP_SRC_LEN, RREGEXP_SRC_PTR, RSTRING_LEN, RSTRING_PTR, and UChar.
Referenced by rb_reg_match_p(), rb_reg_prepare_re(), and rb_reg_search0().
|
static |
Definition at line 2573 of file re.c.
References buf, Qnil, rb_enc_asciicompat, rb_enc_associate(), rb_str_buf_new(), and unescape_nonascii().
Referenced by rb_reg_check_preprocess(), rb_reg_fixed_encoding_p(), rb_reg_initialize(), rb_reg_prepare_re0(), and rb_reg_preprocess_dregexp().
Definition at line 2626 of file re.c.
References ARG_ENCODING_NONE, buf, ENC_CODERANGE_7BIT, err, Qnil, RARRAY_AREF, RARRAY_LEN, rb_ascii8bit_encoding(), rb_eArgError, rb_enc_associate(), rb_enc_get(), rb_enc_name, rb_eRegexpError, rb_raise(), rb_reg_preprocess(), rb_str_buf_append(), rb_str_new3, result, RSTRING_LEN, RSTRING_PTR, str_coderange(), and StringValue.
Referenced by rb_reg_new_ary().
Definition at line 3356 of file re.c.
References mbclen, memcpy, OBJ_INFECT, rb_enc_ascget(), rb_enc_associate(), rb_enc_copy(), rb_enc_get(), rb_enc_mbcput, rb_enc_str_asciionly_p(), rb_str_new(), rb_str_new3, rb_str_resize(), rb_usascii_encoding(), RSTRING_LEN, and RSTRING_PTR.
Referenced by match_regexp(), and rb_reg_s_quote().
Definition at line 661 of file re.c.
References PRIsVALUE, rb_eRegexpError, rb_raise(), and rb_reg_desc().
Referenced by rb_reg_match_p(), rb_reg_prepare_re0(), and rb_reg_search0().
Definition at line 699 of file re.c.
References rb_exc_raise(), and rb_reg_error_desc().
Referenced by rb_reg_init_str(), and rb_reg_init_str_enc().
Definition at line 2867 of file re.c.
References ENCODING_GET, memcmp(), rb_reg_new_str(), reg_cache, reg_hash(), RREGEXP_SRC_LEN, RREGEXP_SRC_PTR, RSTRING_LEN, and RSTRING_PTR.
Referenced by get_pat(), match_regexp(), and rb_str_split_m().
int rb_reg_region_copy | ( | struct re_registers * | to, |
const struct re_registers * | from | ||
) |
Definition at line 912 of file re.c.
References re_registers::allocated, onig_region_copy(), ONIGERR_MEMORY, and rb_gc().
Referenced by match_init_copy(), rb_reg_search0(), and strscan_init_copy().
VALUE rb_reg_regsub | ( | VALUE | str, |
VALUE | src, | ||
struct re_registers * | regs, | ||
VALUE | regexp | ||
) |
Definition at line 3670 of file re.c.
References ASCGET, BEG, END, mbclen, name, name_to_backref_error(), NAME_TO_NUMBER, NIL_P, re_registers::num_regs, onig_noname_group_capture_is_active(), rb_enc_asciicompat, rb_enc_get(), rb_enc_str_buf_cat(), rb_eRuntimeError, rb_raise(), rb_str_buf_new(), rb_str_subseq(), RREGEXP_PTR, RSTRING_LEN, RSTRING_PTR, and val.
Referenced by rb_str_sub_bang(), and str_gsub().
Definition at line 2774 of file re.c.
References FL_WB_PROTECTED, NEWOBJ_OF, RB_OBJ_WRITE, RGENGC_WB_PROTECTED_REGEXP, and T_REGEXP.
Referenced by Init_Regexp(), and rb_reg_alloc().
Definition at line 3866 of file re.c.
References match(), match_backref_number(), match_getter(), NIL_P, Qnil, rb_backref_get(), rb_reg_nth_match(), and rb_scan_args().
Referenced by Init_Regexp().
Definition at line 3468 of file re.c.
References rb_reg_quote(), reg_operand(), and TRUE.
Referenced by Init_Regexp(), and rb_reg_s_union().
Definition at line 3509 of file re.c.
References rb_check_regexp_type().
Referenced by Init_Regexp().
Definition at line 3515 of file re.c.
References argc, NIL_P, Qnil, RARRAY_LEN, rb_ary_entry(), rb_ascii8bit_encoding(), rb_check_regexp_type(), rb_class_new_instance(), rb_cRegexp, rb_eArgError, rb_enc_asciicompat, rb_enc_associate(), rb_enc_copy(), rb_enc_get(), rb_enc_name, rb_enc_str_asciionly_p(), rb_raise(), rb_reg_fixed_encoding_p(), rb_reg_new_str(), rb_reg_s_quote(), rb_reg_to_s(), rb_str_append(), rb_str_buf_cat_ascii(), rb_str_buf_new(), rb_str_new2, and StringValue.
Referenced by rb_reg_s_union_m().
Definition at line 3650 of file re.c.
References NIL_P, RARRAY_LEN, rb_ary_entry(), rb_check_array_type(), and rb_reg_s_union().
Referenced by Init_Regexp().
Definition at line 1586 of file re.c.
References rb_reg_search0().
Referenced by rb_reg_eqq(), rb_reg_match2(), rb_str_index_m(), rb_str_partition(), rb_str_rindex_m(), rb_str_rpartition(), rb_str_split_m(), rb_str_subpat(), rb_str_subpat_set(), and reg_match_pos().
Definition at line 1497 of file re.c.
References err, FL_TAINT, FL_TEST, FL_UNSET, match(), match_alloc(), MATCH_BUSY, MEMZERO, NIL_P, OBJ_INFECT, onig_error_code_to_str(), onig_free(), ONIG_MISMATCH, ONIG_OPTION_NONE, onig_region_free(), onig_search(), Qnil, range, rb_backref_get(), rb_backref_set(), rb_cMatch, rb_memerror(), rb_reg_prepare_re0(), rb_reg_raise(), rb_reg_region_copy(), rb_str_new4, result, RMATCH, RMATCH_REGS, RREGEXP, RREGEXP_PTR, RREGEXP_SRC_LEN, RREGEXP_SRC_PTR, RSTRING_LEN, RSTRING_PTR, and UChar.
Referenced by rb_pat_search(), and rb_reg_search().
Definition at line 498 of file re.c.
References OBJ_TAINT, OBJ_TAINTED, rb_reg_check(), rb_str_dup(), and RREGEXP_SRC.
Referenced by Init_Regexp().
Definition at line 551 of file re.c.
References ALLOCA_N, char_to_option(), err, len, memcpy, NULL, OBJ_INFECT, onig_free(), onig_new(), ONIG_OPTION_DEFAULT, ONIG_OPTION_EXTEND, ONIG_OPTION_IGNORECASE, ONIG_OPTION_MULTILINE, OnigDefaultSyntax, option_to_str(), options(), Qfalse, Qnil, rb_enc_asciicompat, rb_enc_associate(), rb_enc_copy(), rb_enc_from_encoding(), rb_enc_get(), rb_enc_left_char_head, rb_reg_check(), rb_reg_expr_str(), rb_str_buf_cat(), rb_str_buf_cat2(), rb_str_buf_new2(), rb_str_encode(), rb_str_resize(), rb_usascii_encoding(), RREGEXP_PTR, RREGEXP_SRC_LEN, RREGEXP_SRC_PTR, RSTRING_END, RSTRING_LEN, RSTRING_PTR, ruby_verbose, and UChar.
Referenced by Init_Regexp(), and rb_reg_s_union().
|
static |
|
static |
Definition at line 2203 of file re.c.
References errcpy, len, scan_hex, and scan_oct.
Referenced by unescape_escaped_nonascii(), and unescape_nonascii().
Definition at line 1362 of file re.c.
References rb_eEncCompatError, rb_enc_get(), rb_enc_name, and rb_raise().
Referenced by rb_reg_prepare_enc().
|
static |
Definition at line 2895 of file re.c.
References rb_hash_end(), rb_hash_uint(), rb_memhash(), rb_reg_check(), RREGEXP_PTR, RREGEXP_SRC_LEN, and RREGEXP_SRC_PTR.
Referenced by match_hash(), rb_reg_hash(), and rb_reg_regcomp().
Definition at line 3003 of file re.c.
References NIL_P, NUM2INT, Qnil, rb_backref_set(), rb_reg_search(), rb_str_length(), rb_str_offset(), reg_operand(), and TRUE.
Referenced by rb_reg_match(), and rb_reg_match_m().
|
static |
Definition at line 791 of file re.c.
References hash(), INT2NUM, rb_ary_new2, rb_ary_store(), rb_hash_aset(), and rb_str_new().
Referenced by rb_reg_named_captures().
|
static |
Definition at line 756 of file re.c.
References re_pattern_buffer::enc, rb_ary_push(), and rb_enc_str_new().
Referenced by rb_reg_names().
Definition at line 2992 of file re.c.
References rb_check_string_type(), rb_str_to_str(), rb_sym2str, and SYMBOL_P.
Referenced by rb_reg_eqq(), rb_reg_s_quote(), and reg_match_pos().
|
static |
Definition at line 2741 of file re.c.
References rb_enc_associate(), rb_enc_get(), rb_fstring(), RB_OBJ_WRITE, rb_str_dup(), RREGEXP, and RRegexp::src.
Referenced by rb_reg_init_str_enc(), and rb_reg_initialize_str().
|
inlinestatic |
Definition at line 1371 of file re.c.
References ENC_CODERANGE, ENC_CODERANGE_UNKNOWN, and rb_enc_str_coderange().
Referenced by rb_reg_initialize_str(), rb_reg_prepare_enc(), and rb_reg_preprocess_dregexp().
|
static |
Definition at line 2309 of file re.c.
References ALLOCA_N, errcpy, MBCLEN_INVALID_P, MBCLEN_NEEDMORE_P, rb_enc_mbmaxlen, rb_enc_precise_mbclen(), rb_str_buf_cat(), read_escaped_byte(), and snprintf.
Referenced by unescape_nonascii().
|
static |
Definition at line 2459 of file re.c.
References errcpy, len, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, rb_enc_precise_mbclen(), rb_str_buf_cat(), rb_usascii_encoding(), read_escaped_byte(), ruby_scan_oct(), unescape_escaped_nonascii(), unescape_unicode_bmp(), and unescape_unicode_list().
Referenced by rb_reg_preprocess().
|
static |
Definition at line 2436 of file re.c.
References append_utf8(), errcpy, len, and ruby_scan_hex().
Referenced by unescape_nonascii().
|
static |
Definition at line 2399 of file re.c.
References append_utf8(), errcpy, ISSPACE, len, and ruby_scan_hex().
Referenced by unescape_nonascii().
|
static |
Definition at line 939 of file re.c.
References ALLOCA_N, BEG, rmatch_offset::beg, pair_t::byte_pos, rmatch::char_offset, rmatch::char_offset_num_allocated, rmatch::char_offset_updated, pair_t::char_pos, END, rmatch_offset::end, key, re_registers::num_regs, pair_byte_cmp(), rb_enc_get(), rb_enc_mbmaxlen, rb_enc_strlen(), REALLOC_N, rmatch::regs, RMATCH, and RSTRING_PTR.
Referenced by match_begin(), match_end(), and match_offset().
VALUE rb_cMatch |
Definition at line 896 of file re.c.
Referenced by Init_Regexp(), rb_backref_set_string(), and rb_reg_search0().
VALUE rb_cRegexp |
Definition at line 2200 of file re.c.
Referenced by Init_Regexp(), rb_reg_alloc(), and rb_reg_s_union().
VALUE rb_eRegexpError |
Definition at line 19 of file re.c.
Referenced by Init_Regexp(), rb_enc_reg_error_desc(), rb_reg_preprocess_dregexp(), and rb_reg_raise().
|
static |
Definition at line 2864 of file re.c.
Referenced by Init_Regexp(), and rb_reg_regcomp().