33 #define WARN_BUFSIZE 256
35 #define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
79 #ifdef DEFAULT_WARN_FUNCTION
80 static OnigWarnFunc
onig_warn = (OnigWarnFunc )DEFAULT_WARN_FUNCTION;
85 #ifdef DEFAULT_VERB_WARN_FUNCTION
86 static OnigWarnFunc
onig_verb_warn = (OnigWarnFunc )DEFAULT_VERB_WARN_FUNCTION;
121 if (r != 0)
return r;
127 #define BACKREF_REL_TO_ABS(rel_no, env) \
128 ((env)->num_mem + 1 + (rel_no))
130 #define ONOFF(v,f,negative) (negative) ? ((v) &= ~(f)) : ((v) |= (f))
132 #define MBCODE_START_POS(enc) \
133 (OnigCodePoint )(ONIGENC_MBC_MINLEN(enc) > 1 ? 0 : 0x80)
135 #define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf) \
136 add_code_range_to_buf(pbuf, env, MBCODE_START_POS(enc), ~((OnigCodePoint )0))
138 #define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf) do {\
139 if (! ONIGENC_IS_SINGLEBYTE(enc)) {\
140 r = SET_ALL_MULTI_BYTE_RANGE(enc, &(mbuf));\
146 #define BITSET_SET_BIT_CHKDUP(bs, pos) do { \
147 if (BITSET_AT(bs, pos)) CC_DUP_WARN(env); \
148 BS_ROOM(bs, pos) |= BS_BIT(pos); \
151 #define BITSET_IS_EMPTY(bs,empty) do {\
154 for (i = 0; i < (int )BITSET_SIZE; i++) {\
183 for (i = 0; i < (int )
BITSET_SIZE; i++) { bs[
i] = ~(bs[
i]); }
190 for (i = 0; i < (int )
BITSET_SIZE; i++) { to[
i] = ~(from[
i]); }
197 for (i = 0; i < (int )
BITSET_SIZE; i++) { dest[
i] &= bs[
i]; }
204 for (i = 0; i < (int )
BITSET_SIZE; i++) { dest[
i] |= bs[
i]; }
229 ptrdiff_t
len = end - src;
236 #ifdef USE_NAMED_GROUP
251 for (i = 0; i < term_len; i++)
252 r[slen + i] = (
UChar )0;
261 #define PFETCH_READY UChar* pfetch_prev
262 #define PEND (p < end ? 0 : 1)
263 #define PUNFETCH p = pfetch_prev
266 p += enclen(enc, p, end); \
268 #define PFETCH(c) do { \
269 c = ((enc->max_enc_len == 1) ? *p : ONIGENC_MBC_TO_CODE(enc, p, end)); \
271 p += enclen(enc, p, end); \
274 #define PPEEK (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE)
275 #define PPEEK_IS(c) (PPEEK == (OnigCodePoint )c)
296 const UChar* src,
const UChar* src_end,
size_t capa)
308 #ifdef USE_ST_LIBRARY
326 if ((x->
end - x->
s) != (y->
end - y->
s))
332 c = (int )*p - (
int )*q;
333 if (c != 0)
return c;
350 val = val * 997 + (int )*p++;
353 return val + (val >> 5);
365 onig_st_init_table_with_size(&hashType, size);
377 return onig_st_lookup(table, (
st_data_t )(&key), value);
388 key->
s = (
UChar* )str_key;
390 result = onig_st_insert(table, (
st_data_t )key, value);
400 #ifdef USE_NAMED_GROUP
402 #define INIT_NAME_BACKREFS_ALLOC_NUM 8
413 #ifdef USE_ST_LIBRARY
418 #define NAMEBUF_SIZE 24
419 #define NAMEBUF_SIZE_1 25
428 fprintf(fp,
"%s: ", e->
name);
435 if (i > 0) fprintf(fp,
", ");
449 fprintf(fp,
"name table\n");
450 onig_st_foreach(t, i_print_name_entry, (HashDataType )fp);
542 onig_st_foreach(t,
i_names, (HashDataType )&narg);
589 #define INIT_NAMES_ALLOC_NUM 8
606 fprintf(fp,
"name table\n");
607 for (i = 0; i < t->num; i++) {
609 fprintf(fp,
"%s: ", e->
name);
618 if (j > 0) fprintf(fp,
", ");
638 for (i = 0; i < t->num; i++) {
682 len = name_end -
name;
683 for (i = 0; i < t->num; i++) {
701 for (i = 0; i < t->num; i++) {
706 if (r != 0)
return r;
732 if (name_end - name <= 0)
737 #ifdef USE_ST_LIBRARY
753 e->name_len = name_end -
name;
756 e->back_refs = (
int* )
NULL;
761 alloc = INIT_NAMES_ALLOC_NUM;
762 t = (NameTable* )
xmalloc(
sizeof(NameTable));
777 else if (t->num == t->alloc) {
780 alloc = t->alloc * 2;
786 for (i = t->num; i < t->alloc; i++) {
788 t->e[
i].name_len = 0;
789 t->e[
i].back_num = 0;
790 t->e[
i].back_alloc = 0;
791 t->e[
i].back_refs = (
int* )
NULL;
798 e->name_len = name_end -
name;
838 const UChar* name_end,
int** nums)
873 for (i = n - 1; i >= 0; i--) {
886 const UChar* name_end,
int** nums)
918 #ifdef USE_NAMED_GROUP
930 #define INIT_SCANENV_MEMNODES_ALLOC_SIZE 16
945 #ifdef USE_NAMED_GROUP
954 #ifdef USE_COMBINATION_EXPLOSION_CHECK
955 env->num_comb_exp_check = 0;
956 env->comb_exp_max_regnum = 0;
957 env->curr_max_regnum = 0;
958 env->has_recursion = 0;
984 for (i = env->
num_mem + 1; i < alloc; i++)
1007 #ifdef USE_PARSE_TREE_NODE_RECYCLE
1021 switch (
NTYPE(node)) {
1023 if (
NSTR(node)->capa != 0 &&
1035 #ifdef USE_PARSE_TREE_NODE_RECYCLE
1063 if (
NQTFR(node)->target)
1083 #ifdef USE_PARSE_TREE_NODE_RECYCLE
1097 #ifdef USE_PARSE_TREE_NODE_RECYCLE
1106 FreeNodeList = FreeNodeList->
next;
1119 #ifdef USE_PARSE_TREE_NODE_RECYCLE
1122 node = (
Node* )FreeNodeList;
1123 FreeNodeList = FreeNodeList->
next;
1173 for (i = 0; i < n; i++) {
1176 if (j >= sb_out)
goto sb_end;
1192 if (n == 0)
goto is_null;
1196 bbuf->
alloc = n + 1;
1198 bbuf->
p = (
UChar* )((
void* )ranges);
1292 int exist_level,
int nest_level,
1302 NBREF(node)->state = 0;
1303 NBREF(node)->back_num = back_num;
1304 NBREF(node)->back_dynamic = (
int* )
NULL;
1308 #ifdef USE_BACKREF_WITH_LEVEL
1309 if (exist_level != 0) {
1311 NBREF(node)->nest_level = nest_level;
1315 for (i = 0; i < back_num; i++) {
1316 if (backrefs[i] <= env->num_mem &&
1324 for (i = 0; i < back_num; i++)
1325 NBREF(node)->back_static[
i] = backrefs[
i];
1328 int*
p = (
int* )
xmalloc(
sizeof(
int) * back_num);
1333 NBREF(node)->back_dynamic =
p;
1334 for (i = 0; i < back_num; i++)
1340 #ifdef USE_SUBEXP_CALL
1348 NCALL(node)->state = 0;
1351 NCALL(node)->name_end = name_end;
1352 NCALL(node)->group_num = gnum;
1364 NQTFR(node)->state = 0;
1366 NQTFR(node)->lower = lower;
1367 NQTFR(node)->upper = upper;
1368 NQTFR(node)->greedy = 1;
1372 NQTFR(node)->is_refered = 0;
1376 #ifdef USE_COMBINATION_EXPLOSION_CHECK
1377 NQTFR(node)->comb_exp_check_num = 0;
1414 #ifdef USE_SUBEXP_CALL
1432 ptrdiff_t addlen = end - s;
1435 ptrdiff_t len =
NSTR(node)->end -
NSTR(node)->s;
1441 if (capa <=
NSTR(node)->capa) {
1453 NSTR(node)->capa = (int)capa;
1459 NSTR(node)->end =
NSTR(node)->s + len + addlen;
1485 NSTR(node)->flag = flag;
1486 NSTR(node)->capa = 0;
1494 if (
NSTR(node)->capa != 0 &&
1499 NSTR(node)->capa = 0;
1500 NSTR(node)->flag = 0;
1512 NSTR(node)->capa = 0;
1513 NSTR(node)->flag = 0;
1558 if (sn->
end > sn->
s) {
1560 if (p && p > sn->
s) {
1573 if (sn->
end > sn->
s) {
1574 return ((
enclen(enc, sn->
s, sn->
end) < sn->
end - sn->
s) ? 1 : 0);
1579 #ifdef USE_PAD_TO_SHORT_BYTE_CHAR
1586 len = sn->
end - sn->
s;
1591 for (i = 0; i < num; i++) {
1600 unsigned int num, val;
1613 num = num * 10 + val;
1629 unsigned int num, val;
1634 while (!
PEND && maxlen-- != 0) {
1657 unsigned int num, val;
1662 while (!
PEND && maxlen-- != 0) {
1669 num = (num << 3) + val;
1681 #define BBUF_WRITE_CODE_POINT(bbuf,pos,code) \
1682 BBUF_WRITE(bbuf, pos, &(code), SIZE_CODE_POINT)
1691 #define INIT_MULTI_BYTE_RANGE_SIZE (SIZE_CODE_POINT * 5)
1711 int low, high, bound, x;
1716 n = from; from = to; to = n;
1732 for (low = 0, bound = n; low < bound; ) {
1733 x = (low + bound) >> 1;
1734 if (from > data[x*2 + 1])
1740 for (high = low, bound = n; high < bound; ) {
1741 x = (high + bound) >> 1;
1742 if (to >= data[x*2] - 1)
1751 inc_n = low + 1 - high;
1756 if (checkdup && from <= data[low*2+1]
1757 && (data[low*2] <= from || data[low*2+1] <= to))
1759 if (from > data[low*2])
1761 if (to < data[(high - 1)*2 + 1])
1762 to = data[(high - 1)*2 + 1];
1828 if (n <= 0)
goto set_all;
1832 for (i = 0; i < n; i++) {
1835 if (pre <= from - 1) {
1837 if (r != 0)
return r;
1848 #define SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2) do {\
1851 tnot = not1; not1 = not2; not2 = tnot; \
1852 tbuf = bbuf1; bbuf1 = bbuf2; bbuf2 = tbuf; \
1865 if (not1 != 0 || not2 != 0)
1895 if (not2 == 0 && not1 == 0) {
1898 else if (not1 == 0) {
1901 if (r != 0)
return r;
1903 for (i = 0; i < n1; i++) {
1907 if (r != 0)
return r;
1919 for (i = 0; i < n; i++) {
1922 if (from2 < from1) {
1923 if (to2 < from1)
continue;
1928 else if (from2 <= to1) {
1930 if (from1 <= from2 - 1) {
1932 if (r != 0)
return r;
1943 if (from1 > to1)
break;
1947 if (r != 0)
return r;
1981 if (not2 == 0 && not1 == 0) {
1982 for (i = 0; i < n1; i++) {
1985 for (j = 0; j < n2; j++) {
1988 if (from2 > to1)
break;
1989 if (to2 < from1)
continue;
1990 from =
MAX(from1, from2);
1993 if (r != 0)
return r;
1997 else if (not1 == 0) {
1998 for (i = 0; i < n1; i++) {
2002 if (r != 0)
return r;
2014 BBuf *buf1, *buf2, *pbuf = 0;
2034 if (bsr1 != dest->
bs) {
2043 if (not1 != 0 && not2 != 0) {
2048 if (r == 0 && not1 != 0) {
2072 BBuf *buf1, *buf2, *pbuf = 0;
2092 if (bsr1 != dest->
bs) {
2101 if (not1 != 0 && not2 != 0) {
2106 if (r == 0 && not1 != 0) {
2133 case 'n':
return '\n';
2134 case 't':
return '\t';
2135 case 'r':
return '\r';
2136 case 'f':
return '\f';
2137 case 'a':
return '\007';
2138 case 'b':
return '\010';
2139 case 'e':
return '\033';
2146 if ((
'a' <= c && c <=
'z') || (
'A' <= c && c <=
'Z'))
2158 switch (
NTYPE(node)) {
2187 #define is_invalid_quantifier_target(node) 0
2195 if (q->
lower == 0) {
2196 if (q->
upper == 1)
return 0;
2199 else if (q->
lower == 1) {
2204 if (q->
lower == 0) {
2205 if (q->
upper == 1)
return 3;
2208 else if (q->
lower == 1) {
2245 if (pnum < 0 || cnum < 0)
return ;
2247 switch(ReduceTypeTable[cnum][pnum]) {
2336 #ifdef USE_BACKREF_WITH_LEVEL
2357 int low, up, syn_allow, non_low = 0;
2375 if (c ==
')' || c ==
'(' || c ==
'|') {
2395 if (
PEND)
goto invalid;
2419 if (
PEND)
goto invalid;
2425 if (c !=
'}')
goto invalid;
2467 if (v < 0)
return v;
2470 c = ((c & 0xff) | 0x80);
2497 if (v < 0)
return v;
2533 #ifdef USE_NAMED_GROUP
2534 #ifdef USE_BACKREF_WITH_LEVEL
2543 int* rback_num,
int* rlevel)
2545 int r, sign, is_num, exist_level;
2555 is_num = exist_level = 0;
2574 else if (c ==
'-') {
2587 if (c == end_code || c ==
')' || c ==
'+' || c ==
'-') {
2606 if (r == 0 && c != end_code) {
2607 if (c ==
'+' || c ==
'-') {
2609 int flag = (c ==
'-' ? -1 : 1);
2616 *rlevel = (level * flag);
2634 else if (*rback_num == 0)
goto err;
2639 *rname_end = name_end;
2641 return (exist_level ? 1 : 0);
2658 int r, is_num, sign;
2692 else if (c ==
'-') {
2712 if (c == end_code || c ==
')') {
2737 if (c != end_code) {
2745 else if (*rback_num == 0) {
2753 *rname_end = name_end;
2761 if (c == end_code || c ==
')')
2777 int r, is_num, sign;
2790 *rname_end = name_end = end;
2807 else if (c ==
'-') {
2821 if (c == end_code || c ==
')')
break;
2825 if (r == 0 && c != end_code) {
2833 else if (*rback_num == 0) {
2839 *rname_end = name_end;
2859 va_start(args, fmt);
2862 (
const UChar *)fmt, args);
2898 (
env)->warnings_flag |= ONIG_SYN_WARN_CC_DUP;
2921 q = p +
enclen(enc, p, to);
2923 for (i = 1; i < n && q < to; i++) {
2925 if (x != s[i])
break;
2956 q = p +
enclen(enc, p, to);
2958 for (i = 1; i < n && q < to; i++) {
2960 if (x != s[i])
break;
2963 if (i >= n)
return 1;
2968 if (x == bad)
return 0;
2969 else if (x ==
MC_ESC(syn)) in_esc = 1;
3002 else if (c ==
'-') {
3005 else if (c ==
MC_ESC(syn)) {
3018 tok->
u.
prop.not = 0;
3023 tok->
u.
prop.not = 1;
3028 tok->
u.
prop.not = 0;
3033 tok->
u.
prop.not = 1;
3038 tok->
u.
prop.not = 0;
3043 tok->
u.
prop.not = 1;
3049 tok->
u.
prop.not = 0;
3055 tok->
u.
prop.not = 1;
3065 tok->
u.
prop.not = (c ==
'P' ? 1 : 0);
3070 tok->
u.
prop.not = (tok->
u.
prop.not == 0 ? 1 : 0);
3135 case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
3153 if (num < 0)
return num;
3154 if (tok->
u.
c != num) {
3161 else if (c ==
'[') {
3185 else if (c ==
'&') {
3278 if (r < 0)
return r;
3279 if (r == 0)
goto greedy_check;
3282 goto possessive_check;
3308 tok->
u.
prop.not = 0;
3315 tok->
u.
prop.not = 1;
3330 #ifdef USE_WORD_BEGIN_END
3348 tok->
u.
prop.not = 0;
3355 tok->
u.
prop.not = 1;
3362 tok->
u.
prop.not = 0;
3369 tok->
u.
prop.not = 1;
3376 tok->
u.
prop.not = 0;
3383 tok->
u.
prop.not = 1;
3473 case '1':
case '2':
case '3':
case '4':
3474 case '5':
case '6':
case '7':
case '8':
case '9':
3483 (num <= env->num_mem || num <= 9)) {
3493 #ifdef USE_BACKREF_WITH_LEVEL
3500 if (c ==
'8' || c ==
'9') {
3520 else if (c !=
'0') {
3525 #ifdef USE_NAMED_GROUP
3529 if (c ==
'<' || c ==
'\'') {
3536 #ifdef USE_BACKREF_WITH_LEVEL
3539 env, &back_num, &tok->
u.
backref.level);
3540 if (r == 1) tok->
u.
backref.exist_level = 1;
3541 else tok->
u.
backref.exist_level = 0;
3543 r =
fetch_name(&p, end, &name_end, env, &back_num, 1);
3545 if (r < 0)
return r;
3547 if (back_num != 0) {
3555 if (back_num > env->
num_mem ||
3573 for (i = 0; i < num; i++) {
3574 if (backs[i] > env->
num_mem ||
3600 #ifdef USE_SUBEXP_CALL
3604 if (c ==
'<' || c ==
'\'') {
3610 if (r < 0)
return r;
3613 tok->
u.
call.name = prev;
3614 tok->
u.
call.name_end = name_end;
3615 tok->
u.
call.gnum = gnum;
3637 tok->
u.
prop.not = (c ==
'P' ? 1 : 0);
3642 tok->
u.
prop.not = (tok->
u.
prop.not == 0 ? 1 : 0);
3656 if (num < 0)
return num;
3658 if (tok->
u.
c != num) {
3672 #ifdef USE_VARIABLE_META_CHARS
3680 goto zero_or_one_time;
3682 goto one_or_more_time;
3693 #ifdef USE_VARIABLE_META_CHARS
3701 #ifdef USE_VARIABLE_META_CHARS
3712 #ifdef USE_VARIABLE_META_CHARS
3723 #ifdef USE_VARIABLE_META_CHARS
3735 if (r < 0)
return r;
3736 if (r == 0)
goto greedy_check;
3739 goto possessive_check;
3764 if (c ==
')')
break;
3817 case ' ':
case '\t':
case '\n':
case '\r':
case '\f':
3828 #ifdef USE_VARIABLE_META_CHARS
3846 for (i = 0; i < n; i++) {
3853 if (r != 0)
return r;
3864 for ( ; i < n; i++) {
3868 if (r != 0)
return r;
3874 for (i = 0; i < n; i++) {
3884 for (j = prev; j < sb_out; j++) {
3891 for (i = 0; i < n; i++) {
3895 if (r != 0)
return r;
3899 if (prev < 0x7fffffff) {
3901 if (r != 0)
return r;
4018 #define POSIX_BRACKET_CHECK_LIMIT_LENGTH 20
4019 #define POSIX_BRACKET_NAME_MIN_LEN 4
4054 goto not_posix_bracket;
4063 if (r != 0)
return r;
4074 while (!
PEND && ((c =
PPEEK) !=
':') && c !=
']') {
4078 if (c ==
':' && !
PEND) {
4096 UChar *prev, *start, *p = *src;
4112 else if (c ==
'(' || c ==
')' || c ==
'{' || c ==
'|') {
4130 if (ctype < 0)
return ctype;
4136 if (r != 0)
return r;
4170 if (r < 0)
return r;
4181 int* vs_israw,
int v_israw,
4193 if (r < 0)
return r;
4198 if (intype == *type) {
4200 if (*vs > 0xff || v > 0xff)
4213 if (r < 0)
return r;
4228 if (r < 0)
return r;
4248 *vs_israw = v_israw;
4266 if (ignore_escaped && in_esc) {
4271 if (code == c)
return 1;
4282 int r,
neg,
len, fetched, and_start;
4291 int val_israw, in_israw;
4304 if (r < 0)
return r;
4348 int i, base = tok->
base;
4353 if (r < 0)
goto err;
4373 for (i = 1; i <
len; i++) {
4408 r =
next_state_val(cc, &vs, v, &val_israw, in_israw, in_type, &val_type,
4410 if (r != 0)
goto err;
4415 if (r < 0)
goto err;
4428 if (r != 0)
return r;
4432 if (r != 0)
goto err;
4440 if (ctype < 0)
return ctype;
4442 if (r != 0)
return r;
4450 if (r < 0)
goto err;
4470 if (r < 0)
goto err;
4484 if (r < 0)
goto err;
4512 if (r != 0)
goto err;
4520 &val_type, &state, env);
4521 if (r != 0)
goto err;
4529 if (r != 0)
goto err;
4554 if (r < 0)
goto err;
4560 &val_type, &state, env);
4561 if (r != 0)
goto err;
4566 if (r != 0)
goto err;
4583 if (is_empty == 0) {
4584 #define NEWLINE_CODE 0x0a
4616 #ifdef USE_NAMED_GROUP
4637 if (r < 0)
return r;
4639 if (r < 0)
return r;
4654 #ifdef USE_NAMED_GROUP
4670 #ifdef USE_NAMED_GROUP
4685 if (r < 0)
return r;
4688 if (num < 0)
return num;
4693 if (r != 0)
return r;
4697 if (list_capture != 0)
4714 #ifdef USE_NAMED_GROUP
4717 if (c ==
'<' || c ==
'\'') {
4743 #ifdef USE_POSIXLINE_OPTION
4746 case '-':
case 'i':
case 'm':
case 's':
case 'x':
4756 case '-': neg = 1;
break;
4777 #ifdef USE_POSIXLINE_OPTION
4792 else if (c ==
':') {
4797 if (r < 0)
return r;
4800 if (r < 0)
return r;
4825 if (num < 0)
return num;
4831 if (r < 0)
return r;
4839 NANCHOR(*np)->target = target;
4845 if (r != 0)
return r;
4854 "?",
"*",
"+",
"??",
"*?",
"+?"
4858 "",
"",
"*",
"*?",
"??",
"+ and ??",
"+? and ?"
4871 switch (
NTYPE(target)) {
4892 #ifdef USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
4897 switch(ReduceTypeTable[targetq_num][nestq_num]) {
4905 (
UChar* )
"redundant nested repeat operator");
4906 (*onig_verb_warn)((
char* )buf);
4915 (
UChar* )
"nested repeat operator %s and %s was replaced with '%s'",
4916 PopularQStr[targetq_num], PopularQStr[nestq_num],
4917 ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]);
4918 (*onig_verb_warn)((
char* )buf);
4927 if (targetq_num >= 0) {
4928 if (nestq_num >= 0) {
4932 else if (targetq_num == 1 || targetq_num == 2) {
4952 #ifdef USE_SHARED_CCLASS_TABLE
4954 #define THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS 8
4967 if (x->
enc != y->
enc)
return 1;
4968 if (x->
not != y->
not)
return 1;
4980 for (i = 0; i < (int )
sizeof(key->
enc); i++) {
4981 val = val * 997 + (int )*p++;
4985 for (i = 0; i < (int )
sizeof(key->
type); i++) {
4986 val = val * 997 + (int )*p++;
4990 return val + (val >> 5);
5020 onig_st_free_table(OnigTypeCClassTable);
5021 OnigTypeCClassTable =
NULL;
5031 #ifndef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
5043 if (r != 0)
return r;
5065 int to_len,
void* arg)
5079 #ifdef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
5115 for (i = 0; i < to_len; i++) {
5147 int r,
len, group = 0;
5155 switch (tok->
type) {
5164 if (r < 0)
return r;
5165 if (r == 1) group = 1;
5172 if (r < 0)
return r;
5188 if (tok->
escaped)
goto tk_raw_byte;
5200 if (r < 0)
return r;
5204 if (r < 0)
return r;
5229 if (r < 0)
return r;
5232 #ifdef USE_PAD_TO_SHORT_BYTE_CHAR
5236 (void )node_str_head_pad(
NSTR(*np), rem, (
UChar )0);
5247 if (r < 0)
return r;
5258 if (num < 0)
return num;
5259 #ifdef NUMBERED_CHAR_IS_NOT_CASE_AMBIG
5271 UChar *qstart, *qend, *nextp;
5288 switch (tok->
u.
prop.ctype) {
5313 #ifdef USE_SHARED_CCLASS_TABLE
5331 if (
IS_NULL(OnigTypeCClassTable)) {
5333 = onig_st_init_table_with_size(&type_type_cclass_hash, 10);
5334 if (
IS_NULL(OnigTypeCClassTable)) {
5340 if (onig_st_lookup(OnigTypeCClassTable, (
st_data_t )&key,
5358 onig_st_add_direct(OnigTypeCClassTable, (
st_data_t )new_key,
5370 #ifdef USE_SHARED_CCLASS_TABLE
5385 if (r != 0)
return r;
5393 if (r != 0)
return r;
5432 NQTFR(qn)->target = *np;
5449 #ifdef USE_SUBEXP_CALL
5452 int gnum = tok->
u.
call.gnum;
5493 if (r < 0)
return r;
5510 if (tok->
u.
repeat.possessive != 0) {
5540 targetp = &(
NCAR(tmp));
5554 Node *node, **headp;
5557 r =
parse_exp(&node, tok, term, src, end, env);
5568 headp = &(
NCDR(*top));
5570 r =
parse_exp(&node, tok, term, src, end, env);
5579 headp = &(
NCDR(node));
5583 headp = &(
NCDR(*headp));
5597 Node *node, **headp;
5611 headp = &(
NCDR(*top));
5614 if (r < 0)
return r;
5622 headp = &(
NCDR(*headp));
5647 if (r < 0)
return r;
5649 if (r < 0)
return r;
5660 #ifdef USE_NAMED_GROUP
5674 p = (
UChar* )pattern;
#define ONIGERR_UNDEFINED_GROUP_OPTION
static void bitset_set_range(ScanEnv *env, BitSetRef bs, int from, int to)
#define ONIG_SYN_OP2_CCLASS_SET_OP
#define NSTRING_SET_AMBIG(node)
#define ONIGENC_CTYPE_BLANK
#define ONIGENC_CTYPE_PUNCT
void onig_scan_env_set_error_string(ScanEnv *env, int ecode ARG_UNUSED, UChar *arg, UChar *arg_end)
#define NCCLASS_SET_NOT(nd)
static OnigWarnFunc onig_warn
unsigned int OnigCodePoint
void onig_set_warn_func(OnigWarnFunc f)
#define NODE_STR_BUF_SIZE
static int scan_unsigned_hexadecimal_number(UChar **src, UChar *end, int maxlen, OnigEncoding enc)
static int popular_quantifier_num(QtfrNode *q)
struct OnigToken::@58::@60 backref
#define ONIG_MAX_REPEAT_NUM
#define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf)
int onig_foreach_name(regex_t *reg, int(*func)(const UChar *, const UChar *, int, int *, regex_t *, void *), void *arg)
static enum ReduceType const ReduceTypeTable[6][6]
#define IS_REPEAT_INFINITE(n)
#define NCCLASS_SET_SHARE(nd)
#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE
static Node * node_new_list(Node *left, Node *right)
int onig_free_node_list(void)
#define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf)
#define ONIG_SYN_OP2_ESC_U_HEX4
int onig_node_str_cat(Node *node, const UChar *s, const UChar *end)
static void CC_ESC_WARN(ScanEnv *env, UChar *c)
Node * onig_node_list_add(Node *list, Node *x)
#define IS_SYNTAX_BV(syn, bvm)
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE
int onig_st_lookup_strend(hash_table_type *table, const UChar *str_key, const UChar *end_key, hash_data_type *value)
#define ONIG_SYN_OP_ESC_OCTAL3
#define ONIGENC_IS_CODE_WORD(enc, code)
static int fetch_name_with_level(OnigCodePoint start_code, UChar **src, UChar *end, UChar **rname_end, ScanEnv *env, int *rback_num, int *rlevel)
static const char *const PopularQStr[]
#define ONIG_OPTION_SINGLELINE
#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS
void onig_null_warn(const char *s ARG_UNUSED)
#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS
#define BBUF_WRITE_CODE_POINT(bbuf, pos, code)
static int scan_env_add_mem_entry(ScanEnv *env)
#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE
#define ONIG_SYN_OP_BRACE_INTERVAL
#define ANCHOR_WORD_BEGIN
static void bitset_invert_to(BitSetRef from, BitSetRef to)
#define BITSET_SET_BIT(bs, pos)
#define ONIG_SYN_OP2_OPTION_RUBY
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR
#define ONIG_SYN_OP_ASTERISK_ZERO_INF
static void bitset_and(BitSetRef dest, BitSetRef bs)
#define NCCLASS_CLEAR_NOT(nd)
static int scan_unsigned_octal_number(UChar **src, UChar *end, int maxlen, OnigEncoding enc)
#define SCANENV_MEM_NODES(senv)
static int parse_posix_bracket(CClassNode *cc, UChar **src, UChar *end, ScanEnv *env)
#define IS_CODE_SB_WORD(enc, code)
int onig_names_free(regex_t *reg)
#define ANCHOR_BEGIN_LINE
#define IS_SYNTAX_OP(syn, opm)
#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF
int(* func)(const UChar *, const UChar *, int, int *, regex_t *, void *)
static int parse_char_property(Node **np, OnigToken *tok, UChar **src, UChar *end, ScanEnv *env)
int onig_node_str_set(Node *node, const UChar *s, const UChar *end)
#define IS_NCCLASS_NOT(nd)
#define ONIG_REGION_NOTPOS
static void scan_env_clear(ScanEnv *env)
static int parse_branch(Node **top, OnigToken *tok, int term, UChar **src, UChar *end, ScanEnv *env)
#define ONIG_SYN_OP_VBAR_ALT
static const char *const ReduceQStr[]
#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR
#define ONIG_SYN_OP_ESC_W_WORD
static Node * node_new_str_raw(UChar *s, UChar *end)
#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY
#define ONIGERR_END_PATTERN_AT_META
#define ONIG_SYN_OP_QMARK_ZERO_ONE
hash_table_type * onig_st_init_strend_table_with_size(st_index_t size)
struct OnigToken::@58::@62 prop
#define ONIG_MAX_MULTI_BYTE_RANGES_NUM
int onigenc_strlen(OnigEncoding enc, const UChar *p, const UChar *end)
#define IS_SINGLELINE(option)
#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF
static int i_free_shared_class(type_cclass_key *key, Node *node, void *arg ARG_UNUSED)
#define GET_CODE_POINT(code, p)
#define ONIGENC_CTYPE_CNTRL
static void bbuf_free(BBuf *bbuf)
#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT
void rb_compile_warn(const char *file, int line, const char *fmt,...)
#define MC_ANYCHAR_ANYTIME(syn)
Node * onig_node_new_alt(Node *left, Node *right)
#define ONIGENC_CODE_RANGE_TO(range, i)
int onig_st_insert_strend(hash_table_type *table, const UChar *str_key, const UChar *end_key, hash_data_type value)
#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC
#define BIT_STATUS_ON_AT_SIMPLE(stats, n)
#define SCANENV_MEMNODES_SIZE
#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE
#define ONIGENC_CODE_TO_MBC_MAXLEN
static const struct st_hash_type type_type_cclass_hash
#define BBUF_MOVE_RIGHT(buf, from, to, n)
#define ONIG_SYN_OP_QMARK_NON_GREEDY
#define ONIG_SYN_WARN_CC_DUP
#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS
#define ANCHOR_BEGIN_POSITION
struct OnigToken::@58::@61 call
#define ONIGENC_CTYPE_ALNUM
#define ONIG_SYN_OP_DECIMAL_BACKREF
static void CLOSE_BRACKET_WITHOUT_ESC_WARN(ScanEnv *env, UChar *c)
unsigned int OnigOptionType
#define ONIGENC_CTYPE_WORD
#define ANCHOR_NOT_WORD_BOUND
#define ONIG_SYN_OP2_ESC_V_VTAB
#define MC_ONE_OR_MORE_TIME(syn)
#define ONIGENC_CTYPE_ALPHA
#define ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype)
#define ONIGERR_INVALID_CHAR_PROPERTY_NAME
#define ONIG_SYN_OP_POSIX_BRACKET
#define THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS
#define BIT_STATUS_CLEAR(stats)
#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES
static int set_quantifier(Node *qnode, Node *target, int group, ScanEnv *env)
static int i_apply_case_fold(OnigCodePoint from, OnigCodePoint to[], int to_len, void *arg)
static UChar * strcat_capa_from_static(UChar *dest, UChar *dest_end, const UChar *src, const UChar *src_end, size_t capa)
static int add_code_range_to_buf0(BBuf **pbuf, ScanEnv *env, OnigCodePoint from, OnigCodePoint to, int checkdup)
UChar * onigenc_get_prev_char_head(OnigEncoding enc, const UChar *start, const UChar *s, const UChar *end)
#define ONIG_SYN_OP_BRACKET_CC
#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP
#define ONIGENC_CTYPE_UPPER
#define IS_IGNORECASE(option)
#define ONIGERR_END_PATTERN_AT_LEFT_BRACE
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT
Node * mem_nodes_static[SCANENV_MEMNODES_SIZE]
#define enclen(enc, p, e)
static void initialize_cclass(CClassNode *cc)
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME
static Node * node_new_cclass_by_codepoint_range(int not, OnigCodePoint sb_out, const OnigCodePoint ranges[])
#define ONIGENC_CTYPE_DIGIT
#define THREAD_ATOMIC_END
static int parse_regexp(Node **top, UChar **src, UChar *end, ScanEnv *env)
static Node * node_new_quantifier(int lower, int upper, int by_number)
#define IS_NCCLASS_SHARE(nd)
#define ONIG_IS_OPTION_ON(options, option)
static st_table * OnigTypeCClassTable
static Node * node_new_enclose(int type)
static int parse_subexp(Node **top, OnigToken *tok, int term, UChar **src, UChar *end, ScanEnv *env)
static Node * node_new_call(UChar *name, UChar *name_end, int gnum)
OnigCaseFoldType case_fold_flag
#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE
#define ONIG_SYN_OP_ESC_X_BRACE_HEX8
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID
static Node * node_new(void)
#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT
#define INIT_MULTI_BYTE_RANGE_SIZE
#define BBUF_INIT(buf, size)
#define ONIGENC_CTYPE_XDIGIT
#define SET_ENCLOSE_STATUS(node, f)
const OnigSyntaxType * syntax
#define BACKREF_REL_TO_ABS(rel_no, env)
#define ONIGERR_MULTIPLEX_DEFINED_NAME
#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE
static int str_exist_check_with_esc(OnigCodePoint s[], int n, UChar *from, UChar *to, OnigCodePoint bad, OnigEncoding enc, const OnigSyntaxType *syn)
static int add_code_range0(BBuf **pbuf, ScanEnv *env, OnigCodePoint from, OnigCodePoint to, int checkdup)
#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP
#define POSIX_BRACKET_CHECK_LIMIT_LENGTH
#define INIT_NAME_BACKREFS_ALLOC_NUM
#define ONIGERR_INVALID_BACKREF
int onig_name_to_backref_number(regex_t *reg, const UChar *name, const UChar *name_end, OnigRegion *region)
static int fetch_token(OnigToken *tok, UChar **src, UChar *end, ScanEnv *env)
#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE
void onig_snprintf_with_pattern(buf, int bufsize, OnigEncoding enc, UChar *pat, UChar *pat_end, const UChar *fmt, va_alist)
int onig_free_shared_cclass_table(void)
#define ONIG_MAX_BACKREF_NUM
#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING
#define IS_EXTEND(option)
#define CHECK_NULL_RETURN_MEMERR(p)
Node * onig_node_new_enclose(int type)
#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS
void onig_set_verb_warn_func(OnigWarnFunc f)
static UChar * strcat_capa(UChar *dest, UChar *dest_end, const UChar *src, const UChar *src_end, size_t capa)
static OnigCodePoint get_name_end_code_point(OnigCodePoint start)
static UChar * strdup_with_null(OnigEncoding enc, UChar *s, UChar *end)
static int bbuf_clone(BBuf **rto, BBuf *from)
#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT
static FreeNode * FreeNodeList
static int fetch_range_quantifier(UChar **src, UChar *end, OnigToken *tok, ScanEnv *env)
#define ONIG_SYN_OP_ESC_D_DIGIT
static int new_code_range(BBuf **pbuf)
#define is_invalid_quantifier_target(node)
static int name_add(regex_t *reg, UChar *name, UChar *name_end, int backref, ScanEnv *env)
#define BITSET_IS_EMPTY(bs, empty)
#define NSTRING_CLEAR_RAW(node)
#define XDIGITVAL(enc, code)
static int add_code_range(BBuf **pbuf, ScanEnv *env, OnigCodePoint from, OnigCodePoint to)
static int fetch_char_property_to_ctype(UChar **src, UChar *end, ScanEnv *env)
struct _FreeNode FreeNode
const OnigSyntaxType OnigSyntaxRuby
#define ONIGERR_UNDEFINED_NAME_REFERENCE
struct OnigToken::@58::@59 repeat
#define ONIGENC_CODE_TO_MBCLEN(enc, code)
void onig_node_conv_to_str_node(Node *node, int flag)
#define USE_BACKREF_WITH_LEVEL
#define THREAD_ATOMIC_START
SSL_METHOD *(* func)(void)
static int and_code_range1(BBuf **pbuf, ScanEnv *env, OnigCodePoint from1, OnigCodePoint to1, OnigCodePoint *data, int n)
#define BITSET_SET_BIT_CHKDUP(bs, pos)
#define BBUF_MOVE_LEFT_REDUCE(buf, from, to)
#define ONIG_SYN_OP_ESC_X_HEX2
#define ONIGERR_END_PATTERN_IN_GROUP
int onig_name_to_group_numbers(regex_t *reg, const UChar *name, const UChar *name_end, int **nums)
#define SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2)
#define ONIGENC_CODE_RANGE_FROM(range, i)
unsigned char buf[MIME_BUF_SIZE]
#define ONIGENC_CTYPE_PRINT
int onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode *cc)
#define ONIG_NO_SUPPORT_CONFIG
#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META
#define ANCHOR_LOOK_BEHIND_NOT
BitStatusType backrefed_mem
#define NQ_TARGET_ISNOT_EMPTY
#define ONIG_SYN_STRICT_CHECK_BACKREF
static int or_cclass(CClassNode *dest, CClassNode *cc, ScanEnv *env)
#define ONIGENC_CODE_TO_MBC(enc, code, buf)
int onig_strncmp(const UChar *s1, const UChar *s2, int n)
#define ONIG_SYN_ALLOW_INVALID_INTERVAL
static void bitset_or(BitSetRef dest, BitSetRef bs)
Node * onig_node_new_list(Node *left, Node *right)
static int str_end_cmp(st_data_t xp, st_data_t yp)
#define NODE_BACKREFS_SIZE
#define ONIGERR_PARSER_BUG
#define ANCHOR_SEMI_END_BUF
register unsigned int len
#define ONIGENC_IS_CODE_NEWLINE(enc, code)
Node * onig_node_new_str(const UChar *s, const UChar *end)
#define ONIGENC_CTYPE_SPACE
#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL
#define ONIG_SYN_OP2_ESC_H_XDIGIT
void onig_node_str_clear(Node *node)
Node ** mem_nodes_dynamic
#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR
static int names_clear(regex_t *reg)
#define ONIG_OPTION_CAPTURE_GROUP
static Node * node_new_str_raw_char(UChar c)
#define ONIGENC_MBC_TO_CODE(enc, p, end)
#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC
static int fetch_token_in_cc(OnigToken *tok, UChar **src, UChar *end, ScanEnv *env)
static Node * node_new_cclass(void)
#define ONIGENC_MBC_MINLEN(enc)
#define ENCLOSE_STOP_BACKTRACK
#define ONIG_SYN_OP_ESC_BRACE_INTERVAL
UChar * onigenc_step(OnigEncoding enc, const UChar *p, const UChar *end, int n)
#define ONIGERR_EMPTY_CHAR_CLASS
void onig_node_free(Node *node)
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED
#define ONIG_SYN_OP2_OPTION_PERL
#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV
static int and_cclass(CClassNode *dest, CClassNode *cc, ScanEnv *env)
#define NULL_NODE(parser, node)
#define MC_ZERO_OR_ONE_TIME(syn)
static void bitset_copy(BitSetRef dest, BitSetRef bs)
static int i_free_name_entry(UChar *key, NameEntry *e, void *arg ARG_UNUSED)
#define ONIG_SYN_OP_ESC_B_WORD_BOUND
#define CHECK_NULL_RETURN(p)
static int str_node_can_be_split(StrNode *sn, OnigEncoding enc)
static Node * node_new_option(OnigOptionType option)
static Node * node_new_ctype(int type, int not)
static int conv_backslash_value(int c, ScanEnv *env)
int onig_noname_group_capture_is_active(regex_t *reg)
#define MBCODE_START_POS(enc)
#define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
#define BBUF_ENSURE_SIZE(buf, size)
#define ONIG_SYN_OP_PLUS_ONE_INF
static int or_code_range_buf(OnigEncoding enc, BBuf *bbuf1, int not1, BBuf *bbuf2, int not2, BBuf **pbuf, ScanEnv *env)
#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP
#define ONIGENC_IS_CODE_DIGIT(enc, code)
OnigCaseFoldType case_fold_flag
static int scan_env_set_mem_node(ScanEnv *env, int num, Node *node)
#define ONIG_SYN_OP_ESC_VBAR_ALT
#define ANCHOR_PREC_READ_NOT
void onig_reduce_nested_quantifier(Node *pnode, Node *cnode)
static int fetch_escaped_value(UChar **src, UChar *end, ScanEnv *env)
#define ONIG_SYN_OP_DOT_ANYCHAR
static OnigWarnFunc onig_verb_warn
#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS
#define ONIGENC_APPLY_ALL_CASE_FOLD(enc, case_fold_flag, f, arg)
int onig_number_of_names(regex_t *reg)
static int fetch_name(OnigCodePoint start_code, UChar **src, UChar *end, UChar **rname_end, ScanEnv *env, int *rback_num, int ref)
#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED
#define ONIG_OPTION_MULTILINE
static void onig_syntax_warn(ScanEnv *env, const char *fmt,...)
#define BITSET_CLEAR_BIT(bs, pos)
static int parse_enclose(Node **np, OnigToken *tok, int term, UChar **src, UChar *end, ScanEnv *env)
static int node_str_cat_char(Node *node, UChar c)
#define ONIGERR_END_PATTERN_AT_ESCAPE
#define ONIG_OPTION_EXTEND
const OnigSyntaxType * syntax
#define ONIGERR_CONTROL_CODE_SYNTAX
static UChar * find_str_position(OnigCodePoint s[], int n, UChar *from, UChar *to, UChar **next, OnigEncoding enc)
static int and_code_range_buf(BBuf *bbuf1, int not1, BBuf *bbuf2, int not2, BBuf **pbuf, ScanEnv *env)
#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS
struct rb_encoding_entry * list
static NameEntry * name_find(regex_t *reg, const UChar *name, const UChar *name_end)
static int not_code_range_buf(OnigEncoding enc, BBuf *bbuf, BBuf **pbuf, ScanEnv *env)
#define IS_SYNTAX_OP2(syn, opm)
#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC
static int add_ctype_to_cc(CClassNode *cc, int ctype, int not, ScanEnv *env)
#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL
#define ONIGERR_INVALID_POSIX_BRACKET_TYPE
static int i_names(UChar *key ARG_UNUSED, NameEntry *e, INamesArg *arg)
#define ONIG_INEFFECTIVE_META_CHAR
#define ONIGERR_EMPTY_GROUP_NAME
static Node * node_new_empty(void)
static st_index_t type_cclass_hash(type_cclass_key *key)
#define ONIGERR_TOO_BIG_NUMBER
#define ONOFF(v, f, negative)
#define ONIGENC_CODE_RANGE_NUM(range)
static int add_code_range_to_buf(BBuf **pbuf, ScanEnv *env, OnigCodePoint from, OnigCodePoint to)
#define IS_QUANTIFIER_BY_NUMBER(qn)
static void bitset_invert(BitSetRef bs)
#define INIT_SCANENV_MEMNODES_ALLOC_SIZE
static int next_state_val(CClassNode *cc, OnigCodePoint *vs, OnigCodePoint v, int *vs_israw, int v_israw, enum CCVALTYPE intype, enum CCVALTYPE *type, enum CCSTATE *state, ScanEnv *env)
#define ONIGENC_CTYPE_SPECIAL_MASK
#define ONIG_OPTION_DONT_CAPTURE_GROUP
unsigned long hash_data_type
int onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar *p, const UChar *end, const UChar *sascii, int n)
#define ONIG_SYN_OP_ESC_CONTROL_CHARS
int onig_parse_make_tree(Node **root, const UChar *pattern, const UChar *end, regex_t *reg, ScanEnv *env)
int onig_scan_unsigned_number(UChar **src, const UChar *end, OnigEncoding enc)
#define NSTRING_SET_RAW(node)
#define ONIG_OPTION_IGNORECASE
#define ONIG_SYN_OP_LINE_ANCHOR
#define BIT_STATUS_BITS_NUM
#define ONIG_SYN_OP_ESC_S_WHITE_SPACE
static Node * node_new_backref(int back_num, int *backrefs, int by_name, int exist_level, int nest_level, ScanEnv *env)
static Node * node_new_enclose_memory(OnigOptionType option, int is_named)
#define ONIGERR_END_PATTERN_AT_CONTROL
#define ANCHOR_LOOK_BEHIND
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL
#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE
void onig_strcpy(UChar *dest, const UChar *src, const UChar *end)
static int next_state_class(CClassNode *cc, OnigCodePoint *vs, enum CCVALTYPE *type, enum CCSTATE *state, ScanEnv *env)
#define POSIX_BRACKET_NAME_MIN_LEN
#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS
static void UNKNOWN_ESC_WARN(ScanEnv *env, int c)
BitStatusType bt_mem_start
#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS
#define ONIGENC_CTYPE_GRAPH
#define ONIGERR_INVALID_CODE_POINT_VALUE
#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END
#define ONIGENC_IS_SINGLEBYTE(enc)
#define IS_MC_ESC_CODE(code, syn)
#define ANCHOR_WORD_BOUND
#define ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, sbout, ranges)
#define ONIG_SYN_OP_ESC_C_CONTROL
#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN
static int code_exist_check(OnigCodePoint c, UChar *from, UChar *end, int ignore_escaped, ScanEnv *env)
int onig_renumber_name_table(regex_t *reg, GroupNumRemap *map)
#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC
static Node * node_new_str(const UChar *s, const UChar *end)
const OnigSyntaxType * OnigDefaultSyntax
#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND
#define ONIGENC_CTYPE_LOWER
static Node * node_new_anychar(void)
void rb_warn(const char *fmt,...)
#define ONIGENC_CTYPE_ASCII
#define SET_NTYPE(node, ntype)
#define ONIG_SYN_OP_LPAREN_SUBEXP
static Node * str_node_split_last_char(StrNode *sn, OnigEncoding enc)
static int add_ctype_to_cc_by_range(CClassNode *cc, int ctype ARG_UNUSED, int not, ScanEnv *env, OnigCodePoint sb_out, const OnigCodePoint mbr[])
#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY
#define ONIGERR_INVALID_GROUP_NAME
#define ONIGENC_IS_CODE_XDIGIT(enc, code)
static void CC_DUP_WARN(ScanEnv *env)
#define ONIGENC_IS_CODE_CTYPE(enc, code, ctype)
#define ONIGERR_META_CODE_SYNTAX
static int parse_exp(Node **np, OnigToken *tok, int term, UChar **src, UChar *end, ScanEnv *env)
#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY
#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY
#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc, p, end)
static int i_renumber_name(UChar *key ARG_UNUSED, NameEntry *e, GroupNumRemap *map)
void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar *pat, UChar *pat_end, const UChar *fmt, va_list args)
static int parse_char_class(Node **np, OnigToken *tok, UChar **src, UChar *end, ScanEnv *env)
BitStatusType capture_history
static int type_cclass_cmp(type_cclass_key *x, type_cclass_key *y)
#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME
#define ONIGENC_MBC_MAXLEN(enc)
static st_index_t str_end_hash(st_data_t xp)
#define ONIG_SYN_OP_ESC_PLUS_ONE_INF
Node * onig_node_new_anchor(int type)