Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Macros | Functions | Variables
regcomp.c File Reference
#include "regparse.h"
Include dependency graph for regcomp.c:

Go to the source code of this file.

Data Structures

struct  MinMaxLen
 
struct  OptEnv
 
struct  OptAncInfo
 
struct  OptExactInfo
 
struct  OptMapInfo
 
struct  NodeOptInfo
 

Macros

#define IS_NEED_STR_LEN_OP_EXACT(op)
 
#define REPEAT_RANGE_ALLOC   4
 
#define QUANTIFIER_EXPAND_LIMIT_SIZE   50
 
#define CKN_ON   (ckn > 0)
 
#define GET_CHAR_LEN_VARLEN   -1
 
#define GET_CHAR_LEN_TOP_ALT_VARLEN   -2
 
#define RECURSION_EXIST   1
 
#define RECURSION_INFINITE   2
 
#define FOUND_CALLED_NODE   1
 
#define THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION   8
 
#define IN_ALT   (1<<0)
 
#define IN_NOT   (1<<1)
 
#define IN_REPEAT   (1<<2)
 
#define IN_VAR_REPEAT   (1<<3)
 
#define IN_CALL   (1<<4)
 
#define IN_RECCALL   (1<<5)
 
#define EXPAND_STRING_MAX_LENGTH   100
 
#define ALLOWED_TYPE_IN_LB
 
#define ALLOWED_ENCLOSE_IN_LB   ( ENCLOSE_MEMORY | ENCLOSE_OPTION )
 
#define ALLOWED_ENCLOSE_IN_LB_NOT   ENCLOSE_OPTION
 
#define ALLOWED_ANCHOR_IN_LB
 
#define ALLOWED_ANCHOR_IN_LB_NOT
 
#define COMP_EM_BASE   20
 
#define MAX_NODE_OPT_INFO_REF_COUNT   5
 
#define REGEX_TRANSFER(to, from)
 
#define COMPILE_INIT_SIZE   20
 

Functions

OnigCaseFoldType onig_get_default_case_fold_flag (void)
 
int onig_set_default_case_fold_flag (OnigCaseFoldType case_fold_flag)
 
static void swap_node (Node *a, Node *b)
 
static OnigDistance distance_add (OnigDistance d1, OnigDistance d2)
 
static OnigDistance distance_multiply (OnigDistance d, int m)
 
static int bitset_is_empty (BitSetRef bs)
 
int onig_bbuf_init (BBuf *buf, OnigDistance size)
 
static int unset_addr_list_init (UnsetAddrList *uslist, int size)
 
static void unset_addr_list_end (UnsetAddrList *uslist)
 
static int unset_addr_list_add (UnsetAddrList *uslist, int offset, struct _Node *node)
 
static int add_opcode (regex_t *reg, int opcode)
 
static int add_rel_addr (regex_t *reg, int addr)
 
static int add_abs_addr (regex_t *reg, int addr)
 
static int add_length (regex_t *reg, OnigDistance len)
 
static int add_mem_num (regex_t *reg, int num)
 
static int add_option (regex_t *reg, OnigOptionType option)
 
static int add_opcode_rel_addr (regex_t *reg, int opcode, int addr)
 
static int add_bytes (regex_t *reg, UChar *bytes, OnigDistance len)
 
static int add_bitset (regex_t *reg, BitSetRef bs)
 
static int add_opcode_option (regex_t *reg, int opcode, OnigOptionType option)
 
static int compile_length_tree (Node *node, regex_t *reg)
 
static int compile_tree (Node *node, regex_t *reg)
 
static int select_str_opcode (int mb_len, OnigDistance byte_len, int ignore_case)
 
static int compile_tree_empty_check (Node *node, regex_t *reg, int empty_info)
 
static int compile_call (CallNode *node, regex_t *reg)
 
static int compile_tree_n_times (Node *node, int n, regex_t *reg)
 
static int add_compile_string_length (UChar *s ARG_UNUSED, int mb_len, OnigDistance byte_len, regex_t *reg ARG_UNUSED, int ignore_case)
 
static int add_compile_string (UChar *s, int mb_len, OnigDistance byte_len, regex_t *reg, int ignore_case)
 
static int compile_length_string_node (Node *node, regex_t *reg)
 
static int compile_length_string_raw_node (StrNode *sn, regex_t *reg)
 
static int compile_string_node (Node *node, regex_t *reg)
 
static int compile_string_raw_node (StrNode *sn, regex_t *reg)
 
static int add_multi_byte_cclass (BBuf *mbuf, regex_t *reg)
 
static int compile_length_cclass_node (CClassNode *cc, regex_t *reg)
 
static int compile_cclass_node (CClassNode *cc, regex_t *reg)
 
static int entry_repeat_range (regex_t *reg, int id, int lower, int upper)
 
static int compile_range_repeat_node (QtfrNode *qn, int target_len, int empty_info, regex_t *reg)
 
static int is_anychar_star_quantifier (QtfrNode *qn)
 
static int compile_length_quantifier_node (QtfrNode *qn, regex_t *reg)
 
static int compile_quantifier_node (QtfrNode *qn, regex_t *reg)
 
static int compile_length_option_node (EncloseNode *node, regex_t *reg)
 
static int compile_option_node (EncloseNode *node, regex_t *reg)
 
static int compile_length_enclose_node (EncloseNode *node, regex_t *reg)
 
static int get_char_length_tree (Node *node, regex_t *reg, int *len)
 
static int compile_enclose_node (EncloseNode *node, regex_t *reg)
 
static int compile_length_anchor_node (AnchorNode *node, regex_t *reg)
 
static int compile_anchor_node (AnchorNode *node, regex_t *reg)
 
static int noname_disable_map (Node **plink, GroupNumRemap *map, int *counter)
 
static int renumber_node_backref (Node *node, GroupNumRemap *map)
 
static int renumber_by_map (Node *node, GroupNumRemap *map)
 
static int numbered_ref_check (Node *node)
 
static int disable_noname_group_capture (Node **root, regex_t *reg, ScanEnv *env)
 
static int unset_addr_list_fix (UnsetAddrList *uslist, regex_t *reg)
 
static int quantifiers_memory_node_info (Node *node)
 
static int get_min_match_length (Node *node, OnigDistance *min, ScanEnv *env)
 
static int get_max_match_length (Node *node, OnigDistance *max, ScanEnv *env)
 
static int get_char_length_tree1 (Node *node, regex_t *reg, int *len, int level)
 
static int is_not_included (Node *x, Node *y, regex_t *reg)
 
static Nodeget_head_value_node (Node *node, int exact, regex_t *reg)
 
static int check_type_tree (Node *node, int type_mask, int enclose_mask, int anchor_mask)
 
static int subexp_inf_recursive_check (Node *node, ScanEnv *env, int head)
 
static int subexp_inf_recursive_check_trav (Node *node, ScanEnv *env)
 
static int subexp_recursive_check (Node *node)
 
static int subexp_recursive_check_trav (Node *node, ScanEnv *env)
 
static int setup_subexp_call (Node *node, ScanEnv *env)
 
static int divide_look_behind_alternatives (Node *node)
 
static int setup_look_behind (Node *node, regex_t *reg, ScanEnv *env)
 
static int next_setup (Node *node, Node *next_node, regex_t *reg)
 
static int update_string_node_case_fold (regex_t *reg, Node *node)
 
static int expand_case_fold_make_rem_string (Node **rnode, UChar *s, UChar *end, regex_t *reg)
 
static int is_case_fold_variable_len (int item_num, OnigCaseFoldCodeItem items[], int slen)
 
static int expand_case_fold_string_alt (int item_num, OnigCaseFoldCodeItem items[], UChar *p, int slen, UChar *end, regex_t *reg, Node **rnode)
 
static int expand_case_fold_string (Node *node, regex_t *reg)
 
static int setup_tree (Node *node, regex_t *reg, int state, ScanEnv *env)
 
static int set_bm_skip (UChar *s, UChar *end, regex_t *reg, UChar skip[], int **int_skip, int ignore_case)
 
static int map_position_value (OnigEncoding enc, int i)
 
static int distance_value (MinMaxLen *mm)
 
static int comp_distance_value (MinMaxLen *d1, MinMaxLen *d2, int v1, int v2)
 
static int is_equal_mml (MinMaxLen *a, MinMaxLen *b)
 
static void set_mml (MinMaxLen *mml, OnigDistance min, OnigDistance max)
 
static void clear_mml (MinMaxLen *mml)
 
static void copy_mml (MinMaxLen *to, MinMaxLen *from)
 
static void add_mml (MinMaxLen *to, MinMaxLen *from)
 
static void alt_merge_mml (MinMaxLen *to, MinMaxLen *from)
 
static void copy_opt_env (OptEnv *to, OptEnv *from)
 
static void clear_opt_anc_info (OptAncInfo *anc)
 
static void copy_opt_anc_info (OptAncInfo *to, OptAncInfo *from)
 
static void concat_opt_anc_info (OptAncInfo *to, OptAncInfo *left, OptAncInfo *right, OnigDistance left_len, OnigDistance right_len)
 
static int is_left_anchor (int anc)
 
static int is_set_opt_anc_info (OptAncInfo *to, int anc)
 
static void add_opt_anc_info (OptAncInfo *to, int anc)
 
static void remove_opt_anc_info (OptAncInfo *to, int anc)
 
static void alt_merge_opt_anc_info (OptAncInfo *to, OptAncInfo *add)
 
static int is_full_opt_exact_info (OptExactInfo *ex)
 
static void clear_opt_exact_info (OptExactInfo *ex)
 
static void copy_opt_exact_info (OptExactInfo *to, OptExactInfo *from)
 
static void concat_opt_exact_info (OptExactInfo *to, OptExactInfo *add, OnigEncoding enc)
 
static void concat_opt_exact_info_str (OptExactInfo *to, UChar *s, UChar *end, int raw ARG_UNUSED, OnigEncoding enc)
 
static void alt_merge_opt_exact_info (OptExactInfo *to, OptExactInfo *add, OptEnv *env)
 
static void select_opt_exact_info (OnigEncoding enc, OptExactInfo *now, OptExactInfo *alt)
 
static void clear_opt_map_info (OptMapInfo *map)
 
static void copy_opt_map_info (OptMapInfo *to, OptMapInfo *from)
 
static void add_char_opt_map_info (OptMapInfo *map, UChar c, OnigEncoding enc)
 
static int add_char_amb_opt_map_info (OptMapInfo *map, UChar *p, UChar *end, OnigEncoding enc, OnigCaseFoldType case_fold_flag)
 
static void select_opt_map_info (OptMapInfo *now, OptMapInfo *alt)
 
static int comp_opt_exact_or_map_info (OptExactInfo *e, OptMapInfo *m)
 
static void alt_merge_opt_map_info (OnigEncoding enc, OptMapInfo *to, OptMapInfo *add)
 
static void set_bound_node_opt_info (NodeOptInfo *opt, MinMaxLen *mmd)
 
static void clear_node_opt_info (NodeOptInfo *opt)
 
static void copy_node_opt_info (NodeOptInfo *to, NodeOptInfo *from)
 
static void concat_left_node_opt_info (OnigEncoding enc, NodeOptInfo *to, NodeOptInfo *add)
 
static void alt_merge_node_opt_info (NodeOptInfo *to, NodeOptInfo *add, OptEnv *env)
 
static int optimize_node_left (Node *node, NodeOptInfo *opt, OptEnv *env)
 
static int set_optimize_exact_info (regex_t *reg, OptExactInfo *e)
 
static void set_optimize_map_info (regex_t *reg, OptMapInfo *m)
 
static void set_sub_anchor (regex_t *reg, OptAncInfo *anc)
 
static int set_optimize_info_from_tree (Node *node, regex_t *reg, ScanEnv *scan_env)
 
static void clear_optimize_info (regex_t *reg)
 
void onig_free_body (regex_t *reg)
 
void onig_free (regex_t *reg)
 
size_t onig_memsize (const regex_t *reg)
 
size_t onig_region_memsize (const OnigRegion *regs)
 
int onig_compile (regex_t *reg, const UChar *pattern, const UChar *pattern_end, OnigErrorInfo *einfo)
 
int onig_compile_ruby (regex_t *reg, const UChar *pattern, const UChar *pattern_end, OnigErrorInfo *einfo, const char *sourcefile, int sourceline)
 
int onig_reg_init (regex_t *reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType *syntax)
 
int onig_new_without_alloc (regex_t *reg, const UChar *pattern, const UChar *pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType *syntax, OnigErrorInfo *einfo)
 
int onig_new (regex_t **reg, const UChar *pattern, const UChar *pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType *syntax, OnigErrorInfo *einfo)
 
int onig_initialize (OnigEncoding encodings[] ARG_UNUSED, int n ARG_UNUSED)
 
int onig_init (void)
 
void onig_add_end_call (void(*func)(void))
 
static void exec_end_call_list (void)
 
int onig_end (void)
 
int onig_is_in_code_range (const UChar *p, OnigCodePoint code)
 
int onig_is_code_in_cc_len (int elen, OnigCodePoint code, CClassNode *cc)
 
int onig_is_code_in_cc (OnigEncoding enc, OnigCodePoint code, CClassNode *cc)
 

Variables

OnigCaseFoldType OnigDefaultCaseFoldFlag = ONIGENC_CASE_FOLD_MIN
 
static unsigned char PadBuf [WORD_ALIGNMENT_SIZE]
 
static int onig_inited = 0
 
static OnigEndCallListItemTypeEndCallTop
 

Macro Definition Documentation

◆ ALLOWED_ANCHOR_IN_LB

#define ALLOWED_ANCHOR_IN_LB
Value:
ANCHOR_WORD_BOUND | ANCHOR_NOT_WORD_BOUND | \
ANCHOR_WORD_BEGIN | ANCHOR_WORD_END )
#define ANCHOR_BEGIN_LINE
Definition: regint.h:528
#define ANCHOR_BEGIN_POSITION
Definition: regint.h:529
#define ANCHOR_NOT_WORD_BOUND
Definition: regint.h:535
#define ANCHOR_WORD_END
Definition: regint.h:537
#define ANCHOR_LOOK_BEHIND_NOT
Definition: regint.h:541
#define ANCHOR_BEGIN_BUF
Definition: regint.h:527
#define ANCHOR_LOOK_BEHIND
Definition: regint.h:540
#define ANCHOR_KEEP
Definition: regint.h:546

Referenced by setup_tree().

◆ ALLOWED_ANCHOR_IN_LB_NOT

#define ALLOWED_ANCHOR_IN_LB_NOT
Value:
ANCHOR_WORD_BOUND | ANCHOR_NOT_WORD_BOUND | \
ANCHOR_WORD_BEGIN | ANCHOR_WORD_END )
#define ANCHOR_BEGIN_LINE
Definition: regint.h:528
#define ANCHOR_BEGIN_POSITION
Definition: regint.h:529
#define ANCHOR_NOT_WORD_BOUND
Definition: regint.h:535
#define ANCHOR_WORD_END
Definition: regint.h:537
#define ANCHOR_LOOK_BEHIND_NOT
Definition: regint.h:541
#define ANCHOR_BEGIN_BUF
Definition: regint.h:527
#define ANCHOR_LOOK_BEHIND
Definition: regint.h:540
#define ANCHOR_KEEP
Definition: regint.h:546

Referenced by setup_tree().

◆ ALLOWED_ENCLOSE_IN_LB

#define ALLOWED_ENCLOSE_IN_LB   ( ENCLOSE_MEMORY | ENCLOSE_OPTION )

Referenced by setup_tree().

◆ ALLOWED_ENCLOSE_IN_LB_NOT

#define ALLOWED_ENCLOSE_IN_LB_NOT   ENCLOSE_OPTION

Referenced by setup_tree().

◆ ALLOWED_TYPE_IN_LB

#define ALLOWED_TYPE_IN_LB
Value:
#define BIT_NT_STR
Definition: regparse.h:53
#define BIT_NT_ENCLOSE
Definition: regparse.h:59
#define BIT_NT_CCLASS
Definition: regparse.h:54
#define BIT_NT_LIST
Definition: regparse.h:61
#define BIT_NT_CTYPE
Definition: regparse.h:55
#define BIT_NT_ALT
Definition: regparse.h:62
#define BIT_NT_CALL
Definition: regparse.h:63
#define BIT_NT_QTFR
Definition: regparse.h:58
#define BIT_NT_ANCHOR
Definition: regparse.h:60

Referenced by setup_tree().

◆ CKN_ON

#define CKN_ON   (ckn > 0)

Definition at line 722 of file regcomp.c.

◆ COMP_EM_BASE

#define COMP_EM_BASE   20

◆ COMPILE_INIT_SIZE

#define COMPILE_INIT_SIZE   20

Referenced by onig_compile_ruby().

◆ EXPAND_STRING_MAX_LENGTH

#define EXPAND_STRING_MAX_LENGTH   100

Referenced by setup_tree().

◆ FOUND_CALLED_NODE

#define FOUND_CALLED_NODE   1

◆ GET_CHAR_LEN_TOP_ALT_VARLEN

#define GET_CHAR_LEN_TOP_ALT_VARLEN   -2

Definition at line 2411 of file regcomp.c.

Referenced by get_char_length_tree1(), and setup_look_behind().

◆ GET_CHAR_LEN_VARLEN

#define GET_CHAR_LEN_VARLEN   -1

Definition at line 2410 of file regcomp.c.

Referenced by get_char_length_tree1(), and setup_look_behind().

◆ IN_ALT

#define IN_ALT   (1<<0)

Definition at line 3854 of file regcomp.c.

Referenced by setup_tree().

◆ IN_CALL

#define IN_CALL   (1<<4)

Definition at line 3858 of file regcomp.c.

Referenced by setup_tree().

◆ IN_NOT

#define IN_NOT   (1<<1)

Definition at line 3855 of file regcomp.c.

Referenced by setup_tree().

◆ IN_RECCALL

#define IN_RECCALL   (1<<5)

Definition at line 3859 of file regcomp.c.

Referenced by setup_tree().

◆ IN_REPEAT

#define IN_REPEAT   (1<<2)

Definition at line 3856 of file regcomp.c.

Referenced by setup_tree().

◆ IN_VAR_REPEAT

#define IN_VAR_REPEAT   (1<<3)

Definition at line 3857 of file regcomp.c.

Referenced by setup_tree().

◆ IS_NEED_STR_LEN_OP_EXACT

#define IS_NEED_STR_LEN_OP_EXACT (   op)
Value:
((op) == OP_EXACTN || (op) == OP_EXACTMB2N ||\
(op) == OP_EXACTMB3N || (op) == OP_EXACTMBN || (op) == OP_EXACTN_IC)

Definition at line 315 of file regcomp.c.

Referenced by add_compile_string(), and add_compile_string_length().

◆ MAX_NODE_OPT_INFO_REF_COUNT

#define MAX_NODE_OPT_INFO_REF_COUNT   5

Definition at line 4949 of file regcomp.c.

Referenced by optimize_node_left().

◆ QUANTIFIER_EXPAND_LIMIT_SIZE

#define QUANTIFIER_EXPAND_LIMIT_SIZE   50

Definition at line 721 of file regcomp.c.

Referenced by compile_length_quantifier_node(), and compile_quantifier_node().

◆ RECURSION_EXIST

#define RECURSION_EXIST   1

Definition at line 2885 of file regcomp.c.

Referenced by subexp_inf_recursive_check().

◆ RECURSION_INFINITE

#define RECURSION_INFINITE   2

Definition at line 2886 of file regcomp.c.

Referenced by subexp_inf_recursive_check().

◆ REGEX_TRANSFER

#define REGEX_TRANSFER (   to,
  from 
)
Value:
do {\
onig_free_body(to);\
xmemcpy(to, from, sizeof(regex_t));\
xfree(from);\
} while (0)

Definition at line 5675 of file regcomp.c.

◆ REPEAT_RANGE_ALLOC

#define REPEAT_RANGE_ALLOC   4

Referenced by entry_repeat_range().

◆ THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION

#define THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION   8

Referenced by expand_case_fold_string().

Function Documentation

◆ add_abs_addr()

static int add_abs_addr ( regex_t reg,
int  addr 
)
static

Definition at line 231 of file regcomp.c.

References BBUF_ADD, and SIZE_ABSADDR.

Referenced by compile_call(), and compile_enclose_node().

◆ add_bitset()

static int add_bitset ( regex_t reg,
BitSetRef  bs 
)
static

Definition at line 294 of file regcomp.c.

References BBUF_ADD, and SIZE_BITSET.

Referenced by compile_cclass_node().

◆ add_bytes()

static int add_bytes ( regex_t reg,
UChar bytes,
OnigDistance  len 
)
static

Definition at line 287 of file regcomp.c.

References BBUF_ADD.

Referenced by add_compile_string(), add_multi_byte_cclass(), and compile_quantifier_node().

◆ add_char_amb_opt_map_info()

static int add_char_amb_opt_map_info ( OptMapInfo map,
UChar p,
UChar end,
OnigEncoding  enc,
OnigCaseFoldType  case_fold_flag 
)
static

◆ add_char_opt_map_info()

static void add_char_opt_map_info ( OptMapInfo map,
UChar  c,
OnigEncoding  enc 
)
static

◆ add_compile_string()

static int add_compile_string ( UChar s,
int  mb_len,
OnigDistance  byte_len,
regex_t reg,
int  ignore_case 
)
static

◆ add_compile_string_length()

static int add_compile_string_length ( UChar *s  ARG_UNUSED,
int  mb_len,
OnigDistance  byte_len,
regex_t *reg  ARG_UNUSED,
int  ignore_case 
)
static

◆ add_length()

static int add_length ( regex_t reg,
OnigDistance  len 
)
static

Definition at line 240 of file regcomp.c.

References BBUF_ADD, and SIZE_LENGTH.

Referenced by add_compile_string(), add_multi_byte_cclass(), compile_anchor_node(), and compile_tree().

◆ add_mem_num()

static int add_mem_num ( regex_t reg,
int  num 
)
static

◆ add_mml()

static void add_mml ( MinMaxLen to,
MinMaxLen from 
)
static

Definition at line 4484 of file regcomp.c.

References distance_add(), len, MinMaxLen::max, and MinMaxLen::min.

Referenced by concat_left_node_opt_info(), and optimize_node_left().

◆ add_multi_byte_cclass()

static int add_multi_byte_cclass ( BBuf mbuf,
regex_t reg 
)
static

◆ add_opcode()

static int add_opcode ( regex_t reg,
int  opcode 
)
static

◆ add_opcode_option()

static int add_opcode_option ( regex_t reg,
int  opcode,
OnigOptionType  option 
)
static

Definition at line 301 of file regcomp.c.

References add_opcode(), add_option(), compile_length_tree(), and compile_tree().

Referenced by compile_option_node().

◆ add_opcode_rel_addr()

static int add_opcode_rel_addr ( regex_t reg,
int  opcode,
int  addr 
)
static

◆ add_opt_anc_info()

static void add_opt_anc_info ( OptAncInfo to,
int  anc 
)
static

Definition at line 4565 of file regcomp.c.

References is_left_anchor(), OptAncInfo::left_anchor, and OptAncInfo::right_anchor.

Referenced by optimize_node_left().

◆ add_option()

static int add_option ( regex_t reg,
OnigOptionType  option 
)
static

Definition at line 269 of file regcomp.c.

References BBUF_ADD, and SIZE_OPTION.

Referenced by add_opcode_option(), and compile_tree().

◆ add_rel_addr()

static int add_rel_addr ( regex_t reg,
int  addr 
)
static

Definition at line 222 of file regcomp.c.

References BBUF_ADD, and SIZE_RELADDR.

Referenced by add_opcode_rel_addr(), compile_enclose_node(), and compile_range_repeat_node().

◆ alt_merge_mml()

static void alt_merge_mml ( MinMaxLen to,
MinMaxLen from 
)
static

Definition at line 4500 of file regcomp.c.

References MinMaxLen::max, and MinMaxLen::min.

Referenced by alt_merge_node_opt_info(), and alt_merge_opt_map_info().

◆ alt_merge_node_opt_info()

static void alt_merge_node_opt_info ( NodeOptInfo to,
NodeOptInfo add,
OptEnv env 
)
static

◆ alt_merge_opt_anc_info()

static void alt_merge_opt_anc_info ( OptAncInfo to,
OptAncInfo add 
)
static

◆ alt_merge_opt_exact_info()

static void alt_merge_opt_exact_info ( OptExactInfo to,
OptExactInfo add,
OptEnv env 
)
static

◆ alt_merge_opt_map_info()

static void alt_merge_opt_map_info ( OnigEncoding  enc,
OptMapInfo to,
OptMapInfo add 
)
static

◆ bitset_is_empty()

static int bitset_is_empty ( BitSetRef  bs)
static

Definition at line 118 of file regcomp.c.

References BITSET_AT, BITSET_SIZE, and SINGLE_BYTE_SIZE.

Referenced by compile_cclass_node(), and compile_length_cclass_node().

◆ check_type_tree()

static int check_type_tree ( Node node,
int  type_mask,
int  enclose_mask,
int  anchor_mask 
)
static

◆ clear_mml()

static void clear_mml ( MinMaxLen mml)
static

◆ clear_node_opt_info()

static void clear_node_opt_info ( NodeOptInfo opt)
static

◆ clear_opt_anc_info()

static void clear_opt_anc_info ( OptAncInfo anc)
static

◆ clear_opt_exact_info()

static void clear_opt_exact_info ( OptExactInfo ex)
static

◆ clear_opt_map_info()

static void clear_opt_map_info ( OptMapInfo map)
static

Definition at line 4729 of file regcomp.c.

References xmemcpy.

Referenced by alt_merge_opt_map_info(), and clear_node_opt_info().

◆ clear_optimize_info()

static void clear_optimize_info ( regex_t reg)
static

◆ comp_distance_value()

static int comp_distance_value ( MinMaxLen d1,
MinMaxLen d2,
int  v1,
int  v2 
)
static

◆ comp_opt_exact_or_map_info()

static int comp_opt_exact_or_map_info ( OptExactInfo e,
OptMapInfo m 
)
static

◆ compile_anchor_node()

static int compile_anchor_node ( AnchorNode node,
regex_t reg 
)
static

◆ compile_call()

static int compile_call ( CallNode node,
regex_t reg 
)
static

◆ compile_cclass_node()

static int compile_cclass_node ( CClassNode cc,
regex_t reg 
)
static

◆ compile_enclose_node()

static int compile_enclose_node ( EncloseNode node,
regex_t reg 
)
static

◆ compile_length_anchor_node()

static int compile_length_anchor_node ( AnchorNode node,
regex_t reg 
)
static

◆ compile_length_cclass_node()

static int compile_length_cclass_node ( CClassNode cc,
regex_t reg 
)
static

◆ compile_length_enclose_node()

static int compile_length_enclose_node ( EncloseNode node,
regex_t reg 
)
static

◆ compile_length_option_node()

static int compile_length_option_node ( EncloseNode node,
regex_t reg 
)
static

◆ compile_length_quantifier_node()

static int compile_length_quantifier_node ( QtfrNode qn,
regex_t reg 
)
static

◆ compile_length_string_node()

static int compile_length_string_node ( Node node,
regex_t reg 
)
static

◆ compile_length_string_raw_node()

static int compile_length_string_raw_node ( StrNode sn,
regex_t reg 
)
static

Definition at line 503 of file regcomp.c.

References add_compile_string_length(), StrNode::end, and StrNode::s.

Referenced by compile_length_tree().

◆ compile_length_tree()

static int compile_length_tree ( Node node,
regex_t reg 
)
static

◆ compile_option_node()

static int compile_option_node ( EncloseNode node,
regex_t reg 
)
static

◆ compile_quantifier_node()

static int compile_quantifier_node ( QtfrNode qn,
regex_t reg 
)
static

◆ compile_range_repeat_node()

static int compile_range_repeat_node ( QtfrNode qn,
int  target_len,
int  empty_info,
regex_t reg 
)
static

◆ compile_string_node()

static int compile_string_node ( Node node,
regex_t reg 
)
static

◆ compile_string_raw_node()

static int compile_string_raw_node ( StrNode sn,
regex_t reg 
)
static

Definition at line 551 of file regcomp.c.

References add_compile_string(), StrNode::end, and StrNode::s.

Referenced by compile_tree().

◆ compile_tree()

static int compile_tree ( Node node,
regex_t reg 
)
static

◆ compile_tree_empty_check()

static int compile_tree_empty_check ( Node node,
regex_t reg,
int  empty_info 
)
static

◆ compile_tree_n_times()

static int compile_tree_n_times ( Node node,
int  n,
regex_t reg 
)
static

Definition at line 413 of file regcomp.c.

References compile_tree().

Referenced by compile_enclose_node(), and compile_quantifier_node().

◆ concat_left_node_opt_info()

static void concat_left_node_opt_info ( OnigEncoding  enc,
NodeOptInfo to,
NodeOptInfo add 
)
static

◆ concat_opt_anc_info()

static void concat_opt_anc_info ( OptAncInfo to,
OptAncInfo left,
OptAncInfo right,
OnigDistance  left_len,
OnigDistance  right_len 
)
static

◆ concat_opt_exact_info()

static void concat_opt_exact_info ( OptExactInfo to,
OptExactInfo add,
OnigEncoding  enc 
)
static

◆ concat_opt_exact_info_str()

static void concat_opt_exact_info_str ( OptExactInfo to,
UChar s,
UChar end,
int raw  ARG_UNUSED,
OnigEncoding  enc 
)
static

Definition at line 4642 of file regcomp.c.

References enclen, re_registers::end, len, OptExactInfo::len, OPT_EXACT_MAXLEN, OptExactInfo::s, and UChar.

Referenced by optimize_node_left().

◆ copy_mml()

static void copy_mml ( MinMaxLen to,
MinMaxLen from 
)
static

Definition at line 4477 of file regcomp.c.

References MinMaxLen::max, and MinMaxLen::min.

Referenced by set_bound_node_opt_info().

◆ copy_node_opt_info()

static void copy_node_opt_info ( NodeOptInfo to,
NodeOptInfo from 
)
static

Definition at line 4872 of file regcomp.c.

Referenced by optimize_node_left().

◆ copy_opt_anc_info()

static void copy_opt_anc_info ( OptAncInfo to,
OptAncInfo from 
)
static

Definition at line 4520 of file regcomp.c.

Referenced by concat_left_node_opt_info(), and concat_opt_exact_info().

◆ copy_opt_env()

static void copy_opt_env ( OptEnv to,
OptEnv from 
)
static

Definition at line 4507 of file regcomp.c.

Referenced by optimize_node_left().

◆ copy_opt_exact_info()

static void copy_opt_exact_info ( OptExactInfo to,
OptExactInfo from 
)
static

◆ copy_opt_map_info()

static void copy_opt_map_info ( OptMapInfo to,
OptMapInfo from 
)
static

Definition at line 4757 of file regcomp.c.

Referenced by optimize_node_left(), and select_opt_map_info().

◆ disable_noname_group_capture()

static int disable_noname_group_capture ( Node **  root,
regex_t reg,
ScanEnv env 
)
static

◆ distance_add()

static OnigDistance distance_add ( OnigDistance  d1,
OnigDistance  d2 
)
static

Definition at line 96 of file regcomp.c.

References ONIG_INFINITE_DISTANCE.

Referenced by add_mml(), get_char_length_tree1(), and get_max_match_length().

◆ distance_multiply()

static OnigDistance distance_multiply ( OnigDistance  d,
int  m 
)
static

◆ distance_value()

static int distance_value ( MinMaxLen mm)
static

Definition at line 4411 of file regcomp.c.

References MinMaxLen::max, MinMaxLen::min, numberof, and ONIG_INFINITE_DISTANCE.

Referenced by comp_distance_value().

◆ divide_look_behind_alternatives()

static int divide_look_behind_alternatives ( Node node)
static

◆ entry_repeat_range()

static int entry_repeat_range ( regex_t reg,
int  id,
int  lower,
int  upper 
)
static

◆ exec_end_call_list()

static void exec_end_call_list ( void  )
static

Definition at line 6036 of file regcomp.c.

References EndCallTop, func, OnigEndCallListItem::func, OnigEndCallListItem::next, and xfree().

Referenced by onig_end().

◆ expand_case_fold_make_rem_string()

static int expand_case_fold_make_rem_string ( Node **  rnode,
UChar s,
UChar end,
regex_t reg 
)
static

◆ expand_case_fold_string()

static int expand_case_fold_string ( Node node,
regex_t reg 
)
static

◆ expand_case_fold_string_alt()

static int expand_case_fold_string_alt ( int  item_num,
OnigCaseFoldCodeItem  items[],
UChar p,
int  slen,
UChar end,
regex_t reg,
Node **  rnode 
)
static

◆ get_char_length_tree()

static int get_char_length_tree ( Node node,
regex_t reg,
int *  len 
)
static

◆ get_char_length_tree1()

static int get_char_length_tree1 ( Node node,
regex_t reg,
int *  len,
int  level 
)
static

◆ get_head_value_node()

static Node* get_head_value_node ( Node node,
int  exact,
regex_t reg 
)
static

◆ get_max_match_length()

static int get_max_match_length ( Node node,
OnigDistance max,
ScanEnv env 
)
static

◆ get_min_match_length()

static int get_min_match_length ( Node node,
OnigDistance min,
ScanEnv env 
)
static

◆ is_anychar_star_quantifier()

static int is_anychar_star_quantifier ( QtfrNode qn)
static

◆ is_case_fold_variable_len()

static int is_case_fold_variable_len ( int  item_num,
OnigCaseFoldCodeItem  items[],
int  slen 
)
static

Definition at line 3435 of file regcomp.c.

Referenced by expand_case_fold_string().

◆ is_equal_mml()

static int is_equal_mml ( MinMaxLen a,
MinMaxLen b 
)
static

Definition at line 4457 of file regcomp.c.

References MinMaxLen::max, and MinMaxLen::min.

Referenced by alt_merge_opt_exact_info().

◆ is_full_opt_exact_info()

static int is_full_opt_exact_info ( OptExactInfo ex)
static

Definition at line 4590 of file regcomp.c.

References OptExactInfo::len, and OPT_EXACT_MAXLEN.

Referenced by optimize_node_left().

◆ is_left_anchor()

static int is_left_anchor ( int  anc)
static

◆ is_not_included()

static int is_not_included ( Node x,
Node y,
regex_t reg 
)
static

◆ is_set_opt_anc_info()

static int is_set_opt_anc_info ( OptAncInfo to,
int  anc 
)
static

Definition at line 4557 of file regcomp.c.

References OptAncInfo::left_anchor, and OptAncInfo::right_anchor.

Referenced by optimize_node_left().

◆ map_position_value()

static int map_position_value ( OnigEncoding  enc,
int  i 
)
static

Definition at line 4387 of file regcomp.c.

References numberof, and ONIGENC_MBC_MINLEN.

Referenced by add_char_opt_map_info(), alt_merge_opt_map_info(), and select_opt_exact_info().

◆ next_setup()

static int next_setup ( Node node,
Node next_node,
regex_t reg 
)
static

◆ noname_disable_map()

static int noname_disable_map ( Node **  plink,
GroupNumRemap map,
int *  counter 
)
static

◆ numbered_ref_check()

static int numbered_ref_check ( Node node)
static

◆ onig_add_end_call()

void onig_add_end_call ( void(*)(void)  func)

◆ onig_bbuf_init()

int onig_bbuf_init ( BBuf buf,
OnigDistance  size 
)

Definition at line 142 of file regcomp.c.

References _BBuf::alloc, IS_NULL, NULL, ONIGERR_MEMORY, _BBuf::p, UChar, _BBuf::used, and xmalloc.

◆ onig_compile()

int onig_compile ( regex_t reg,
const UChar pattern,
const UChar pattern_end,
OnigErrorInfo einfo 
)

Definition at line 5698 of file regcomp.c.

References NULL, and onig_compile_ruby().

Referenced by onig_new(), and onig_new_without_alloc().

◆ onig_compile_ruby()

int onig_compile_ruby ( regex_t reg,
const UChar pattern,
const UChar pattern_end,
OnigErrorInfo einfo,
const char *  sourcefile,
int  sourceline 
)

Definition at line 5707 of file regcomp.c.

References add_opcode(), re_pattern_buffer::alloc, ScanEnv::backrefed_mem, BBUF_INIT, BIT_STATUS_AT, BIT_STATUS_ON_ALL, ScanEnv::bt_mem_end, re_pattern_buffer::bt_mem_end, ScanEnv::bt_mem_start, re_pattern_buffer::bt_mem_start, ScanEnv::capture_history, re_pattern_buffer::capture_history, clear_optimize_info(), COMPILE_INIT_SIZE, compile_tree(), disable_noname_group_capture(), ScanEnv::enc, OnigErrorInfo::enc, re_pattern_buffer::enc, re_registers::end, err, ScanEnv::error, ScanEnv::error_end, IS_FIND_CONDITION, IS_NOT_NULL, IS_SYNTAX_BV, ScanEnv::mem_nodes_dynamic, NULL, ScanEnv::num_call, re_pattern_buffer::num_call, re_pattern_buffer::num_comb_exp_check, ScanEnv::num_mem, re_pattern_buffer::num_mem, ScanEnv::num_named, re_pattern_buffer::num_null_check, re_pattern_buffer::num_repeat, numbered_ref_check(), ONIG_IS_OPTION_ON, onig_node_free(), ONIG_OPTION_CAPTURE_GROUP, onig_parse_make_tree(), ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP, OP_END, re_pattern_buffer::options, OnigErrorInfo::par, OnigErrorInfo::par_end, re_pattern_buffer::repeat_range, re_pattern_buffer::repeat_range_alloc, set_optimize_info_from_tree(), setup_subexp_call(), setup_tree(), ScanEnv::sourcefile, ScanEnv::sourceline, re_pattern_buffer::stack_pop_level, STACK_POP_LEVEL_ALL, STACK_POP_LEVEL_FREE, STACK_POP_LEVEL_MEM_START, subexp_inf_recursive_check_trav(), subexp_recursive_check_trav(), ScanEnv::syntax, UChar, ScanEnv::unset_addr_list, unset_addr_list_end(), unset_addr_list_fix(), unset_addr_list_init(), USE_SUBEXP_CALL, re_pattern_buffer::used, and xfree().

Referenced by onig_compile(), and onig_new_with_source().

◆ onig_end()

int onig_end ( void  )

Definition at line 6052 of file regcomp.c.

References exec_end_call_list().

◆ onig_free()

void onig_free ( regex_t reg)

Definition at line 5641 of file regcomp.c.

References IS_NOT_NULL, onig_free_body(), and xfree().

Referenced by onig_free_body(), and onig_new().

◆ onig_free_body()

void onig_free_body ( regex_t reg)

◆ onig_get_default_case_fold_flag()

OnigCaseFoldType onig_get_default_case_fold_flag ( void  )

Definition at line 36 of file regcomp.c.

References OnigDefaultCaseFoldFlag.

◆ onig_init()

int onig_init ( void  )

Definition at line 5998 of file regcomp.c.

References onigenc_init().

Referenced by onig_initialize(), and onig_reg_init().

◆ onig_initialize()

int onig_initialize ( OnigEncoding encodings []  ARG_UNUSED,
int n  ARG_UNUSED 
)

Definition at line 5992 of file regcomp.c.

References onig_init().

◆ onig_is_code_in_cc()

int onig_is_code_in_cc ( OnigEncoding  enc,
OnigCodePoint  code,
CClassNode cc 
)

Definition at line 6114 of file regcomp.c.

References add, ALIGNMENT_RIGHT, ANCHOR_BEGIN_BUF, ANCHOR_BEGIN_LINE, ANCHOR_BEGIN_POSITION, ANCHOR_END_BUF, ANCHOR_END_LINE, ANCHOR_KEEP, ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_NOT_WORD_BOUND, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, ANCHOR_SEMI_END_BUF, ANCHOR_WORD_BEGIN, ANCHOR_WORD_BOUND, ANCHOR_WORD_END, BRefNode::back_num, BACKREFS_P, bp, re_pattern_buffer::enc, enclen, ENCLOSE_ABSENT, ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, re_registers::end, GET_ABSADDR_INC, GET_CODE_POINT, GET_LENGTH_INC, GET_MEMNUM_INC, GET_OPTION_INC, GET_RELADDR_INC, IS_NCCLASS_NOT, IS_NOT_NULL, IS_NULL, len, level, CallNode::name, CallNode::name_end, NANCHOR, NBREF, NCALL, NCAR, NCCLASS, NCDR, NCTYPE, NENCLOSE, NQTFR, NSTR, NSTRING_IS_RAW, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, onig_is_code_in_cc_len(), ONIGENC_CODE_TO_MBCLEN, ONIGENC_CTYPE_WORD, ONIGENC_MBC_MINLEN, OP_ABSENT, OP_ABSENT_END, OP_ANYCHAR, OP_ANYCHAR_ML, OP_ANYCHAR_ML_STAR, OP_ANYCHAR_ML_STAR_PEEK_NEXT, OP_ANYCHAR_STAR, OP_ANYCHAR_STAR_PEEK_NEXT, OP_ASCII_WORD, OP_ASCII_WORD_BEGIN, OP_ASCII_WORD_BOUND, OP_ASCII_WORD_END, OP_BACKREF1, OP_BACKREF2, OP_BACKREF_MULTI, OP_BACKREF_MULTI_IC, OP_BACKREF_WITH_LEVEL, OP_BACKREFN, OP_BACKREFN_IC, OP_BEGIN_BUF, OP_BEGIN_LINE, OP_BEGIN_POSITION, OP_CALL, OP_CCLASS, OP_CCLASS_MB, OP_CCLASS_MB_NOT, OP_CCLASS_MIX, OP_CCLASS_MIX_NOT, OP_CCLASS_NOT, OP_CONDITION, OP_END, OP_END_BUF, OP_END_LINE, OP_EXACT1, OP_EXACT1_IC, OP_EXACT2, OP_EXACT3, OP_EXACT4, OP_EXACT5, OP_EXACTMB2N, OP_EXACTMB2N1, OP_EXACTMB2N2, OP_EXACTMB2N3, OP_EXACTMB3N, OP_EXACTMBN, OP_EXACTN, OP_EXACTN_IC, OP_FAIL, OP_FAIL_LOOK_BEHIND_NOT, OP_FAIL_POS, OP_FINISH, OP_JUMP, OP_KEEP, OP_LOOK_BEHIND, OP_MEMORY_END, OP_MEMORY_END_PUSH, OP_MEMORY_END_PUSH_REC, OP_MEMORY_END_REC, OP_MEMORY_START, OP_MEMORY_START_PUSH, OP_NOT_ASCII_WORD, OP_NOT_ASCII_WORD_BOUND, OP_NOT_WORD, OP_NOT_WORD_BOUND, OP_NULL_CHECK_END, OP_NULL_CHECK_END_MEMST, OP_NULL_CHECK_END_MEMST_PUSH, OP_NULL_CHECK_START, OP_POP, OP_POP_POS, OP_POP_STOP_BT, OP_PUSH, OP_PUSH_ABSENT_POS, OP_PUSH_IF_PEEK_NEXT, OP_PUSH_LOOK_BEHIND_NOT, OP_PUSH_OR_JUMP_EXACT1, OP_PUSH_POS, OP_PUSH_POS_NOT, OP_PUSH_STOP_BT, OP_REPEAT, OP_REPEAT_INC, OP_REPEAT_INC_NG, OP_REPEAT_INC_NG_SG, OP_REPEAT_INC_SG, OP_REPEAT_NG, OP_RETURN, OP_SEMI_END_BUF, OP_SET_OPTION, OP_SET_OPTION_PUSH, OP_STATE_CHECK, OP_STATE_CHECK_ANYCHAR_ML_STAR, OP_STATE_CHECK_ANYCHAR_STAR, OP_STATE_CHECK_PUSH, OP_STATE_CHECK_PUSH_OR_JUMP, OP_WORD, OP_WORD_BEGIN, OP_WORD_BOUND, OP_WORD_END, _BBuf::p, re_pattern_buffer::p, PRIxPTR, SIZE_BITSET, SIZE_MEMNUM, SIZE_OPTION, SIZE_RELADDR, SIZE_STATE_CHECK_NUM, TRUE, UChar, _BBuf::used, and re_pattern_buffer::used.

Referenced by i_apply_case_fold(), and is_not_included().

◆ onig_is_code_in_cc_len()

int onig_is_code_in_cc_len ( int  elen,
OnigCodePoint  code,
CClassNode cc 
)

◆ onig_is_in_code_range()

int onig_is_in_code_range ( const UChar p,
OnigCodePoint  code 
)

Definition at line 6070 of file regcomp.c.

References GET_CODE_POINT.

Referenced by match_at(), and onig_is_code_in_cc_len().

◆ onig_memsize()

size_t onig_memsize ( const regex_t reg)

◆ onig_new()

int onig_new ( regex_t **  reg,
const UChar pattern,
const UChar pattern_end,
OnigOptionType  option,
OnigEncoding  enc,
const OnigSyntaxType syntax,
OnigErrorInfo einfo 
)

◆ onig_new_without_alloc()

int onig_new_without_alloc ( regex_t reg,
const UChar pattern,
const UChar pattern_end,
OnigOptionType  option,
OnigEncoding  enc,
const OnigSyntaxType syntax,
OnigErrorInfo einfo 
)

Definition at line 5956 of file regcomp.c.

References onig_compile(), onig_reg_init(), and ONIGENC_CASE_FOLD_DEFAULT.

◆ onig_reg_init()

int onig_reg_init ( regex_t reg,
OnigOptionType  option,
OnigCaseFoldType  case_fold_flag,
OnigEncoding  enc,
const OnigSyntaxType syntax 
)

◆ onig_region_memsize()

size_t onig_region_memsize ( const OnigRegion regs)

Definition at line 5666 of file regcomp.c.

References re_registers::allocated, re_registers::beg, re_registers::end, IS_NULL, and size.

Referenced by obj_memsize_of(), and strscan_memsize().

◆ onig_set_default_case_fold_flag()

int onig_set_default_case_fold_flag ( OnigCaseFoldType  case_fold_flag)

Definition at line 42 of file regcomp.c.

References OnigDefaultCaseFoldFlag.

◆ optimize_node_left()

static int optimize_node_left ( Node node,
NodeOptInfo opt,
OptEnv env 
)
static

Definition at line 4952 of file regcomp.c.

References add_char_amb_opt_map_info(), add_char_opt_map_info(), add_mml(), add_opt_anc_info(), alt_merge_node_opt_info(), NodeOptInfo::anc, ANCHOR_ANYCHAR_STAR, ANCHOR_ANYCHAR_STAR_MASK, ANCHOR_ANYCHAR_STAR_ML, ANCHOR_BEGIN_BUF, ANCHOR_BEGIN_LINE, ANCHOR_BEGIN_POSITION, ANCHOR_END_BUF, ANCHOR_END_LINE, ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, ANCHOR_SEMI_END_BUF, BRefNode::back_num, ScanEnv::backrefed_mem, BACKREFS_P, BIT_STATUS_AT, BITSET_AT, CClassNode::bs, OptEnv::case_fold_flag, clear_node_opt_info(), concat_left_node_opt_info(), concat_opt_exact_info(), concat_opt_exact_info_str(), copy_node_opt_info(), copy_opt_env(), copy_opt_exact_info(), copy_opt_map_info(), distance_multiply(), OptEnv::enc, ENCLOSE_ABSENT, ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, StrNode::end, NodeOptInfo::exb, NodeOptInfo::exm, NodeOptInfo::expr, get_max_match_length(), get_min_match_length(), QtfrNode::greedy, OptExactInfo::ignore_case, IS_CALL_RECURSION, IS_ENCLOSE_MAX_FIXED, IS_ENCLOSE_MIN_FIXED, is_full_opt_exact_info(), IS_MULTILINE, IS_NCCLASS_NOT, IS_NOT_NULL, IS_REPEAT_INFINITE, is_set_opt_anc_info(), OptExactInfo::len, NodeOptInfo::len, QtfrNode::lower, NodeOptInfo::map, max(), MinMaxLen::max, EncloseNode::max_len, MAX_NODE_OPT_INFO_REF_COUNT, CClassNode::mbuf, MinMaxLen::min, EncloseNode::min_len, OptEnv::mmd, NANCHOR, NBREF, NCALL, NCAR, NCCLASS, NCDR, NCTYPE, NENCLOSE, NQTFR, NST_RECURSION, NSTR, NSTRING_IS_AMBIG, NSTRING_IS_DONT_GET_OPT_INFO, NSTRING_IS_RAW, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, ONIG_INFINITE_DISTANCE, ONIGENC_CTYPE_WORD, ONIGENC_IS_CODE_WORD, ONIGENC_MBC_MAXLEN_DIST, ONIGENC_MBC_MINLEN, onigenc_strlen(), ONIGERR_TYPE_BUG, EncloseNode::opt_count, EncloseNode::option, OptEnv::options, OptExactInfo::reach_end, EncloseNode::regnum, remove_opt_anc_info(), StrNode::s, OptEnv::scan_env, SCANENV_MEM_NODES, set_bound_node_opt_info(), set_mml(), SINGLE_BYTE_SIZE, BRefNode::state, QtfrNode::target, EncloseNode::target, EncloseNode::type, UChar, QtfrNode::upper, and OptMapInfo::value.

Referenced by set_optimize_info_from_tree().

◆ quantifiers_memory_node_info()

static int quantifiers_memory_node_info ( Node node)
static

◆ remove_opt_anc_info()

static void remove_opt_anc_info ( OptAncInfo to,
int  anc 
)
static

Definition at line 4574 of file regcomp.c.

References is_left_anchor(), OptAncInfo::left_anchor, and OptAncInfo::right_anchor.

Referenced by optimize_node_left().

◆ renumber_by_map()

static int renumber_by_map ( Node node,
GroupNumRemap map 
)
static

◆ renumber_node_backref()

static int renumber_node_backref ( Node node,
GroupNumRemap map 
)
static

◆ select_opt_exact_info()

static void select_opt_exact_info ( OnigEncoding  enc,
OptExactInfo now,
OptExactInfo alt 
)
static

◆ select_opt_map_info()

static void select_opt_map_info ( OptMapInfo now,
OptMapInfo alt 
)
static

◆ select_str_opcode()

static int select_str_opcode ( int  mb_len,
OnigDistance  byte_len,
int  ignore_case 
)
static

◆ set_bm_skip()

static int set_bm_skip ( UChar s,
UChar end,
regex_t reg,
UChar  skip[],
int **  int_skip,
int  ignore_case 
)
static

◆ set_bound_node_opt_info()

static void set_bound_node_opt_info ( NodeOptInfo opt,
MinMaxLen mmd 
)
static

◆ set_mml()

static void set_mml ( MinMaxLen mml,
OnigDistance  min,
OnigDistance  max 
)
static

Definition at line 4464 of file regcomp.c.

References max(), MinMaxLen::max, and MinMaxLen::min.

Referenced by optimize_node_left().

◆ set_optimize_exact_info()

static int set_optimize_exact_info ( regex_t reg,
OptExactInfo e 
)
static

◆ set_optimize_info_from_tree()

static int set_optimize_info_from_tree ( Node node,
regex_t reg,
ScanEnv scan_env 
)
static

◆ set_optimize_map_info()

static void set_optimize_map_info ( regex_t reg,
OptMapInfo m 
)
static

◆ set_sub_anchor()

static void set_sub_anchor ( regex_t reg,
OptAncInfo anc 
)
static

◆ setup_look_behind()

static int setup_look_behind ( Node node,
regex_t reg,
ScanEnv env 
)
static

◆ setup_subexp_call()

static int setup_subexp_call ( Node node,
ScanEnv env 
)
static

◆ setup_tree()

static int setup_tree ( Node node,
regex_t reg,
int  state,
ScanEnv env 
)
static

Definition at line 3870 of file regcomp.c.

References ALLOWED_ANCHOR_IN_LB, ALLOWED_ANCHOR_IN_LB_NOT, ALLOWED_ENCLOSE_IN_LB, ALLOWED_ENCLOSE_IN_LB_NOT, ALLOWED_TYPE_IN_LB, ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, BRefNode::back_num, ScanEnv::backrefed_mem, BACKREFS_P, BIT_STATUS_ON_AT, ScanEnv::bt_mem_end, ScanEnv::bt_mem_start, buf, OnigCaseFoldCodeItem::byte_len, re_pattern_buffer::case_fold_flag, check_type_tree(), re_pattern_buffer::enc, enclen, ENCLOSE_ABSENT, ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, StrNode::end, re_registers::end, expand_case_fold_string(), EXPAND_STRING_MAX_LENGTH, StrNode::flag, get_head_value_node(), get_max_match_length(), get_min_match_length(), QtfrNode::greedy, QtfrNode::head_exact, IN_ALT, IN_CALL, IN_NOT, IN_RECCALL, IN_REPEAT, IN_VAR_REPEAT, IS_BACKREF_NEST_LEVEL, IS_ENCLOSE_CALLED, IS_ENCLOSE_NAME_REF, IS_ENCLOSE_RECURSION, IS_IGNORECASE, IS_NODE_TYPE_SIMPLE, IS_NOT_NULL, IS_NULL, IS_REPEAT_INFINITE, IS_SYNTAX_BV, len, QtfrNode::lower, NANCHOR, NBREF, NCAR, NCDR, NENCLOSE, next_setup(), NQ_TARGET_IS_EMPTY, NQTFR, NST_IN_REPEAT, NST_MEM_BACKREFED, NST_STOP_BT_SIMPLE_REPEAT, NSTR, NSTRING_IS_RAW, NSTRING_LEN, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, NULL, NULL_NODE, ScanEnv::num_mem, ScanEnv::num_named, ONIG_CHAR_TABLE_SIZE, ONIG_IS_OPTION_ON, onig_node_free(), onig_node_list_add(), onig_node_new_list(), onig_node_new_str(), onig_node_str_cat(), ONIG_OPTION_CAPTURE_GROUP, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP, ONIGENC_CODE_TO_MBC, ONIGENC_GET_CASE_FOLD_CODES_BY_STR, ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM, ONIGENC_MBC_CASE_FOLD_MAXLEN, ONIGERR_INVALID_BACKREF, ONIGERR_INVALID_LOOK_BEHIND_PATTERN, ONIGERR_MEMORY, ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED, ONIGERR_TYPE_BUG, ScanEnv::option, re_pattern_buffer::options, options(), quantifiers_memory_node_info(), EncloseNode::regnum, StrNode::s, SCANENV_MEM_NODES, set_bm_skip(), SET_CALL_RECURSION, SET_ENCLOSE_STATUS, setup_look_behind(), QtfrNode::state, swap_node(), ScanEnv::syntax, QtfrNode::target, EncloseNode::target, AnchorNode::target, QtfrNode::target_empty_info, EncloseNode::type, AnchorNode::type, UChar, QtfrNode::upper, and xmalloc.

Referenced by onig_compile_ruby().

◆ subexp_inf_recursive_check()

static int subexp_inf_recursive_check ( Node node,
ScanEnv env,
int  head 
)
static

◆ subexp_inf_recursive_check_trav()

static int subexp_inf_recursive_check_trav ( Node node,
ScanEnv env 
)
static

◆ subexp_recursive_check()

static int subexp_recursive_check ( Node node)
static

◆ subexp_recursive_check_trav()

static int subexp_recursive_check_trav ( Node node,
ScanEnv env 
)
static

◆ swap_node()

static void swap_node ( Node a,
Node b 
)
static

◆ unset_addr_list_add()

static int unset_addr_list_add ( UnsetAddrList uslist,
int  offset,
struct _Node node 
)
static

◆ unset_addr_list_end()

static void unset_addr_list_end ( UnsetAddrList uslist)
static

Definition at line 175 of file regcomp.c.

References IS_NOT_NULL, UnsetAddrList::us, and xfree().

Referenced by onig_compile_ruby().

◆ unset_addr_list_fix()

static int unset_addr_list_fix ( UnsetAddrList uslist,
regex_t reg 
)
static

◆ unset_addr_list_init()

static int unset_addr_list_init ( UnsetAddrList uslist,
int  size 
)
static

◆ update_string_node_case_fold()

static int update_string_node_case_fold ( regex_t reg,
Node node 
)
static

Variable Documentation

◆ EndCallTop

OnigEndCallListItemType* EndCallTop
static

Definition at line 6020 of file regcomp.c.

Referenced by exec_end_call_list(), and onig_add_end_call().

◆ onig_inited

int onig_inited = 0
static

Definition at line 5909 of file regcomp.c.

◆ OnigDefaultCaseFoldFlag

OnigCaseFoldType OnigDefaultCaseFoldFlag = ONIGENC_CASE_FOLD_MIN

Definition at line 33 of file regcomp.c.

Referenced by onig_get_default_case_fold_flag(), and onig_set_default_case_fold_flag().

◆ PadBuf

unsigned char PadBuf[WORD_ALIGNMENT_SIZE]
static

Definition at line 50 of file regcomp.c.

Referenced by add_multi_byte_cclass().