Ruby
2.5.0dev(2017-10-22revision60238)
|
#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 |
#define ARG_ENCODING_NONE 32 |
Definition at line 288 of file re.c.
Referenced by rb_char_to_option_kcode().
#define ARG_REG_OPTION_MASK (ONIG_OPTION_IGNORECASE|ONIG_OPTION_MULTILINE|ONIG_OPTION_EXTEND) |
#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 errcpy | ( | err, | |
msg | |||
) | strlcpy((err), (msg), ONIG_MAX_ERROR_MESSAGE_LEN) |
#define NAME_TO_NUMBER | ( | regs, | |
re, | |||
name, | |||
name_ptr, | |||
name_end | |||
) |
Definition at line 1898 of file re.c.
Referenced by rb_reg_regsub().
typedef char onig_errmsg_buffer[ONIG_MAX_ERROR_MESSAGE_LEN] |
void Init_Regexp | ( | void | ) |
Definition at line 3979 of file re.c.
References ONIG_ENCODING_ASCII, onig_set_warn_func(), onigenc_set_default_encoding(), rb_define_class(), rb_eRegexpError, and rb_eStandardError.
NORETURN | ( | static void | name_to_backref_errorVALUE name | ) |
void rb_backref_set_string | ( | VALUE | string, |
long | pos, | ||
long | len | ||
) |
int rb_char_to_option_kcode | ( | int | c, |
int * | option, | ||
int * | kcode | ||
) |
Definition at line 324 of file re.c.
References ARG_ENCODING_NONE, ENCINDEX_EUC_JP, ENCINDEX_Windows_31J, rb_ascii8bit_encindex(), and rb_utf8_encindex().
Referenced by rb_reg_fragment_setenc().
Definition at line 3555 of file re.c.
References rb_check_convert_type(), and T_REGEXP.
VALUE rb_enc_reg_new | ( | const char * | s, |
long | len, | ||
rb_encoding * | enc, | ||
int | options | ||
) |
Definition at line 79 of file re.c.
Referenced by rb_num_get_rounding_option().
long rb_memsearch | ( | const void * | x0, |
long | m, | ||
const void * | y0, | ||
long | n, | ||
rb_encoding * | enc | ||
) |
Definition at line 244 of file re.c.
References LIKELY, memcmp(), rb_enc_mbminlen, and SIZEOF_VALUE.
Definition at line 2672 of file re.c.
References buf, err, rb_enc_get(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Definition at line 2919 of file re.c.
Referenced by rb_parser_reg_compile().
Definition at line 3202 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.
Definition at line 2893 of file re.c.
References rb_reg_new_str().
Definition at line 2861 of file re.c.
Referenced by rb_reg_new_ary().
Definition at line 1450 of file re.c.
References err, and rb_reg_prepare_re0().
regex_t* rb_reg_prepare_re0 | ( | VALUE | re, |
VALUE | str, | ||
onig_errmsg_buffer | err | ||
) |
Definition at line 3425 of file re.c.
References mbclen, 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.
int rb_reg_region_copy | ( | struct re_registers * | to, |
const struct re_registers * | from | ||
) |
Definition at line 904 of file re.c.
References re_registers::allocated, onig_region_copy(), ONIGERR_MEMORY, and rb_gc().
VALUE rb_reg_regsub | ( | VALUE | str, |
VALUE | src, | ||
struct re_registers * | regs, | ||
VALUE | regexp | ||
) |
Definition at line 3739 of file re.c.
References ASCGET, mbclen, name, NAME_TO_NUMBER, NIL_P, onig_noname_group_capture_is_active(), rb_enc_asciicompat, rb_enc_get(), rb_enc_str_buf_cat(), rb_str_buf_new(), rb_str_subseq(), RREGEXP_PTR, RSTRING_LEN, RSTRING_PTR, and val.
Definition at line 1489 of file re.c.
Referenced by rb_reg_search().
VALUE rb_eRegexpError |
Definition at line 19 of file re.c.
Referenced by Init_Regexp().