34 #define WARN_BUFSIZE 256 36 #define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS 89 #ifdef DEFAULT_WARN_FUNCTION 95 #ifdef DEFAULT_VERB_WARN_FUNCTION 119 return ParseDepthLimit;
128 ParseDepthLimit = depth;
134 bbuf_free(
BBuf* bbuf)
151 if (r != 0)
return r;
157 #define BACKREF_REL_TO_ABS(rel_no, env) \ 158 ((env)->num_mem + 1 + (rel_no)) 160 #define ONOFF(v,f,negative) (negative) ? ((v) &= ~(f)) : ((v) |= (f)) 162 #define MBCODE_START_POS(enc) \ 163 (OnigCodePoint )(ONIGENC_MBC_MINLEN(enc) > 1 ? 0 : 0x80) 165 #define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf) \ 166 add_code_range_to_buf(pbuf, env, MBCODE_START_POS(enc), ONIG_LAST_CODE_POINT) 168 #define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf) do {\ 169 if (! ONIGENC_IS_SINGLEBYTE(enc)) {\ 170 r = SET_ALL_MULTI_BYTE_RANGE(enc, &(mbuf));\ 176 #define BITSET_SET_BIT_CHKDUP(bs, pos) do { \ 177 if (BITSET_AT(bs, pos)) CC_DUP_WARN(env); \ 178 BS_ROOM(bs, pos) |= BS_BIT(pos); \ 181 #define BITSET_IS_EMPTY(bs,empty) do {\ 184 for (i = 0; i < BITSET_SIZE; i++) {\ 213 for (i = 0; i <
BITSET_SIZE; i++) { bs[i] = ~(bs[i]); }
220 for (i = 0; i <
BITSET_SIZE; i++) { to[i] = ~(from[i]); }
227 for (i = 0; i <
BITSET_SIZE; i++) { dest[i] &= bs[i]; }
234 for (i = 0; i <
BITSET_SIZE; i++) { dest[i] |= bs[i]; }
241 for (i = 0; i <
BITSET_SIZE; i++) { dest[i] = bs[i]; }
244 #if defined(USE_NAMED_GROUP) && !defined(USE_ST_LIBRARY) 261 ptrdiff_t
len = end - src;
268 #ifdef USE_NAMED_GROUP 283 for (i = 0; i < term_len; i++)
284 r[slen + i] = (
UChar )0;
295 # define PFETCH_READY UChar* pfetch_prev = NULL; (void)pfetch_prev 297 # define PFETCH_READY UChar* pfetch_prev 299 #define PEND (p < end ? 0 : 1) 300 #define PUNFETCH p = pfetch_prev 303 p += enclen(enc, p, end); \ 305 #define PFETCH(c) do { \ 306 c = ((enc->max_enc_len == 1) ? *p : ONIGENC_MBC_TO_CODE(enc, p, end)); \ 308 p += enclen(enc, p, end); \ 311 #define PINC_S do { \ 312 p += enclen(enc, p, end); \ 314 #define PFETCH_S(c) do { \ 315 c = ((enc->max_enc_len == 1) ? *p : ONIGENC_MBC_TO_CODE(enc, p, end)); \ 316 p += enclen(enc, p, end); \ 319 #define PPEEK (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE) 320 #define PPEEK_IS(c) (PPEEK == (OnigCodePoint )c) 340 strcat_capa_from_static(
UChar* dest,
UChar* dest_end,
341 const UChar* src,
const UChar* src_end,
size_t capa)
353 #ifdef USE_ST_LIBRARY 375 if ((x->
end - x->
s) != (y->
end - y->
s))
381 c = (int )*p - (
int )*q;
382 if (c != 0)
return c;
399 val = val * 997 + (int )*p++;
402 return val + (val >> 5);
414 onig_st_init_table_with_size(&hashType, size);
426 return onig_st_lookup(table, (
st_data_t )(&key), value);
437 key->
s = (
UChar* )str_key;
439 result = onig_st_insert(table, (
st_data_t )key, value);
449 #ifdef USE_NAMED_GROUP 451 # define INIT_NAME_BACKREFS_ALLOC_NUM 8 462 # ifdef USE_ST_LIBRARY 474 fprintf(fp,
"%s: ", e->
name);
481 if (i > 0) fprintf(fp,
", ");
495 fprintf(fp,
"name table\n");
496 onig_st_foreach(t, i_print_name_entry, (
HashDataType )fp);
519 onig_st_foreach(t, i_free_name_entry, 0);
530 r = names_clear(reg);
616 onig_st_foreach(t, i_renumber_name, (
HashDataType )map);
635 # define INIT_NAMES_ALLOC_NUM 8 652 fprintf(fp,
"name table\n");
653 for (i = 0; i < t->num; i++) {
655 fprintf(fp,
"%s: ", e->
name);
664 if (j > 0) fprintf(fp,
", ");
684 for (i = 0; i < t->num; i++) {
711 r = names_clear(reg);
728 len = name_end -
name;
729 for (i = 0; i < t->num; i++) {
747 for (i = 0; i < t->num; i++) {
752 if (r != 0)
return r;
778 if (name_end - name <= 0)
781 e = name_find(reg, name, name_end);
783 # ifdef USE_ST_LIBRARY 791 e->
name = strdup_with_null(reg->
enc, name, name_end);
799 e->name_len = name_end -
name;
802 e->back_refs = (
int* )
NULL;
807 alloc = INIT_NAMES_ALLOC_NUM;
823 else if (t->num == t->alloc) {
827 alloc = t->alloc * 2;
834 for (i = t->num; i < t->alloc; i++) {
836 t->e[i].name_len = 0;
837 t->e[i].back_num = 0;
838 t->e[i].back_alloc = 0;
839 t->e[i].back_refs = (
int* )
NULL;
844 e->name = strdup_with_null(reg->
enc, name, name_end);
846 e->name_len = name_end -
name;
888 const UChar* name_end,
int** nums)
890 NameEntry* e = name_find(reg, name, name_end);
923 for (i = n - 1; i >= 0; i--) {
936 const UChar* name_end,
int** nums)
968 #ifdef USE_NAMED_GROUP 980 #define INIT_SCANENV_MEMNODES_ALLOC_SIZE 16 995 #ifdef USE_NAMED_GROUP 1004 #ifdef USE_COMBINATION_EXPLOSION_CHECK
1005 env->num_comb_exp_check = 0;
1006 env->comb_exp_max_regnum = 0;
1007 env->curr_max_regnum = 0;
1008 env->has_recursion = 0;
1015 scan_env_add_mem_entry(
ScanEnv* env)
1038 for (i = env->
num_mem + 1; i < alloc; i++)
1051 scan_env_set_mem_node(
ScanEnv* env,
int num,
Node* node)
1067 switch (
NTYPE(node)) {
1069 if (
NSTR(node)->capa != 0 &&
1092 bbuf_free(cc->
mbuf);
1097 if (
NQTFR(node)->target)
1140 node_new_cclass(
void)
1142 Node* node = node_new();
1146 initialize_cclass(
NCCLASS(node));
1151 node_new_ctype(
int type,
int not,
int ascii_range)
1153 Node* node = node_new();
1157 NCTYPE(node)->ctype = type;
1159 NCTYPE(node)->ascii_range = ascii_range;
1164 node_new_anychar(
void)
1166 Node* node = node_new();
1174 node_new_list(
Node* left,
Node* right)
1176 Node* node = node_new();
1188 return node_new_list(left, right);
1212 Node* node = node_new();
1224 Node* node = node_new();
1231 NANCHOR(node)->ascii_range = 0;
1236 node_new_backref(
int back_num,
int* backrefs,
int by_name,
1238 int exist_level,
int nest_level,
1243 Node* node = node_new();
1248 NBREF(node)->state = 0;
1249 NBREF(node)->back_num = back_num;
1250 NBREF(node)->back_dynamic = (
int* )
NULL;
1254 #ifdef USE_BACKREF_WITH_LEVEL 1255 if (exist_level != 0) {
1257 NBREF(node)->nest_level = nest_level;
1261 for (i = 0; i < back_num; i++) {
1262 if (backrefs[i] <= env->num_mem &&
1270 for (i = 0; i < back_num; i++)
1271 NBREF(node)->back_static[i] = backrefs[i];
1274 int* p = (
int* )
xmalloc(
sizeof(
int) * back_num);
1279 NBREF(node)->back_dynamic = p;
1280 for (i = 0; i < back_num; i++)
1286 #ifdef USE_SUBEXP_CALL 1288 node_new_call(
UChar* name,
UChar* name_end,
int gnum)
1290 Node* node = node_new();
1294 NCALL(node)->state = 0;
1297 NCALL(node)->name_end = name_end;
1298 NCALL(node)->group_num = gnum;
1304 node_new_quantifier(
int lower,
int upper,
int by_number)
1306 Node* node = node_new();
1310 NQTFR(node)->state = 0;
1312 NQTFR(node)->lower = lower;
1313 NQTFR(node)->upper = upper;
1314 NQTFR(node)->greedy = 1;
1318 NQTFR(node)->is_refered = 0;
1322 #ifdef USE_COMBINATION_EXPLOSION_CHECK 1323 NQTFR(node)->comb_exp_check_num = 0;
1330 node_new_enclose(
int type)
1332 Node* node = node_new();
1349 return node_new_enclose(type);
1360 #ifdef USE_SUBEXP_CALL 1378 ptrdiff_t addlen = end - s;
1387 if (capa <=
NSTR(node)->capa) {
1392 p = strcat_capa_from_static(
NSTR(node)->s,
NSTR(node)->end,
1395 p = strcat_capa(
NSTR(node)->s,
NSTR(node)->end, s, end, capa);
1399 NSTR(node)->capa = (int )capa;
1405 NSTR(node)->end =
NSTR(node)->s + len + addlen;
1432 if (num < 0)
return num;
1441 NSTR(node)->flag = flag;
1442 NSTR(node)->capa = 0;
1451 if (
NSTR(node)->capa != 0 &&
1456 NSTR(node)->capa = 0;
1457 NSTR(node)->flag = 0;
1463 node_new_str(
const UChar* s,
const UChar* end)
1465 Node* node = node_new();
1469 NSTR(node)->capa = 0;
1470 NSTR(node)->flag = 0;
1483 return node_new_str(s, end);
1489 Node* node = node_new_str(s, end);
1496 node_new_empty(
void)
1502 node_new_str_raw_char(
UChar c)
1507 return node_new_str_raw(p, p + 1);
1516 if (sn->
end > sn->
s) {
1518 if (p && p > sn->
s) {
1519 n = node_new_str(p, sn->
end);
1531 if (sn->
end > sn->
s) {
1532 return ((
enclen(enc, sn->
s, sn->
end) < sn->
end - sn->
s) ? 1 : 0);
1537 #ifdef USE_PAD_TO_SHORT_BYTE_CHAR 1544 len = sn->
end - sn->
s;
1549 for (i = 0; i < num; i++) {
1558 unsigned int num,
val;
1571 num = num * 10 +
val;
1583 scan_unsigned_hexadecimal_number(
UChar** src,
UChar* end,
int minlen,
1587 unsigned int num,
val;
1592 restlen = maxlen - minlen;
1594 while (!
PEND && maxlen-- != 0) {
1609 if (maxlen > restlen)
1616 scan_unsigned_octal_number(
UChar** src,
UChar* end,
int maxlen,
1620 unsigned int num,
val;
1625 while (!
PEND && maxlen-- != 0) {
1632 num = (num << 3) + val;
1644 #define BBUF_WRITE_CODE_POINT(bbuf,pos,code) \ 1645 BBUF_WRITE(bbuf, pos, &(code), SIZE_CODE_POINT) 1652 new_code_range(
BBuf** pbuf)
1654 #define INIT_MULTI_BYTE_RANGE_SIZE (SIZE_CODE_POINT * 5) 1679 n = from; from = to; to = n;
1683 r = new_code_range(pbuf);
1695 bound = (from == 0) ? 0 : n;
1696 for (low = 0; low < bound; ) {
1697 x = (low + bound) >> 1;
1698 if (from - 1 > data[x*2 + 1])
1705 for (bound = n; high < bound; ) {
1706 x = (high + bound) >> 1;
1707 if (to + 1 >= data[x*2])
1716 inc_n = low + 1 - high;
1721 if (checkdup && from <= data[low*2+1]
1722 && (data[low*2] <= from || data[low*2+1] <= to))
1724 if (from > data[low*2])
1726 if (to < data[(high - 1)*2 + 1])
1727 to = data[(high - 1)*2 + 1];
1758 return add_code_range_to_buf0(pbuf, env, from, to, 1);
1771 return add_code_range_to_buf0(pbuf, env, from, to, checkdup);
1777 return add_code_range0(pbuf, env, from, to, 1);
1795 if (n <= 0)
goto set_all;
1799 for (i = 0; i < n; i++) {
1802 if (pre <= from - 1) {
1803 r = add_code_range_to_buf(pbuf, env, pre, from - 1);
1804 if (r != 0)
return r;
1815 #define SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2) do {\ 1818 tnot = not1; not1 = not2; not2 = tnot; \ 1819 tbuf = bbuf1; bbuf1 = bbuf2; bbuf2 = tbuf; \ 1832 if (not1 != 0 || not2 != 0)
1847 return bbuf_clone(pbuf, bbuf2);
1850 return not_code_range_buf(enc, bbuf2, pbuf, env);
1862 if (not2 == 0 && not1 == 0) {
1863 r = bbuf_clone(pbuf, bbuf2);
1865 else if (not1 == 0) {
1866 r = not_code_range_buf(enc, bbuf2, pbuf, env);
1868 if (r != 0)
return r;
1870 for (i = 0; i < n1; i++) {
1873 r = add_code_range_to_buf(pbuf, env, from, to);
1874 if (r != 0)
return r;
1886 for (i = 0; i < n; i++) {
1889 if (from2 < from1) {
1890 if (to2 < from1)
continue;
1895 else if (from2 <= to1) {
1897 if (from1 <= from2 - 1) {
1898 r = add_code_range_to_buf(pbuf, env, from1, from2-1);
1899 if (r != 0)
return r;
1910 if (from1 > to1)
break;
1913 r = add_code_range_to_buf(pbuf, env, from1, to1);
1914 if (r != 0)
return r;
1920 and_code_range_buf(
BBuf* bbuf1,
int not1,
BBuf* bbuf2,
int not2,
BBuf** pbuf,
ScanEnv* env)
1929 return bbuf_clone(pbuf, bbuf2);
1934 return bbuf_clone(pbuf, bbuf1);
1948 if (not2 == 0 && not1 == 0) {
1949 for (i = 0; i < n1; i++) {
1952 for (j = 0; j < n2; j++) {
1955 if (from2 > to1)
break;
1956 if (to2 < from1)
continue;
1957 from =
MAX(from1, from2);
1959 r = add_code_range_to_buf(pbuf, env, from, to);
1960 if (r != 0)
return r;
1964 else if (not1 == 0) {
1965 for (i = 0; i < n1; i++) {
1968 r = and_code_range1(pbuf, env, from1, to1, data2, n2);
1969 if (r != 0)
return r;
1981 BBuf *buf1, *buf2, *pbuf = 0;
1993 bitset_invert_to(bsr1, bs1);
1997 bitset_invert_to(bsr2, bs2);
2000 bitset_and(bsr1, bsr2);
2001 if (bsr1 != dest->
bs) {
2002 bitset_copy(dest->
bs, bsr1);
2006 bitset_invert(dest->
bs);
2010 if (not1 != 0 && not2 != 0) {
2011 r = or_code_range_buf(enc, buf1, 0, buf2, 0, &pbuf, env);
2014 r = and_code_range_buf(buf1, not1, buf2, not2, &pbuf, env);
2015 if (r == 0 && not1 != 0) {
2017 r = not_code_range_buf(enc, pbuf, &tbuf, env);
2039 BBuf *buf1, *buf2, *pbuf = 0;
2051 bitset_invert_to(bsr1, bs1);
2055 bitset_invert_to(bsr2, bs2);
2058 bitset_or(bsr1, bsr2);
2059 if (bsr1 != dest->
bs) {
2060 bitset_copy(dest->
bs, bsr1);
2064 bitset_invert(dest->
bs);
2068 if (not1 != 0 && not2 != 0) {
2069 r = and_code_range_buf(buf1, 0, buf2, 0, &pbuf, env);
2072 r = or_code_range_buf(enc, buf1, not1, buf2, not2, &pbuf, env);
2073 if (r == 0 && not1 != 0) {
2075 r = not_code_range_buf(enc, pbuf, &tbuf, env);
2093 static void UNKNOWN_ESC_WARN(
ScanEnv *env,
int c);
2100 case 'n':
return '\n';
2101 case 't':
return '\t';
2102 case 'r':
return '\r';
2103 case 'f':
return '\f';
2104 case 'a':
return '\007';
2105 case 'b':
return '\010';
2106 case 'e':
return '\033';
2113 if ((
'a' <= c && c <=
'z') || (
'A' <= c && c <=
'Z'))
2114 UNKNOWN_ESC_WARN(env, c);
2121 #ifdef USE_NO_INVALID_QUANTIFIER 2122 # define is_invalid_quantifier_target(node) 0 2127 switch (
NTYPE(node)) {
2159 popular_quantifier_num(
QtfrNode* q)
2162 if (q->
lower == 0) {
2163 if (q->
upper == 1)
return 0;
2166 else if (q->
lower == 1) {
2171 if (q->
lower == 0) {
2172 if (q->
upper == 1)
return 3;
2175 else if (q->
lower == 1) {
2193 static enum ReduceType const ReduceTypeTable[6][6] = {
2211 pnum = popular_quantifier_num(p);
2212 cnum = popular_quantifier_num(c);
2213 if (pnum < 0 || cnum < 0)
return ;
2215 switch (ReduceTypeTable[cnum][pnum]) {
2309 #ifdef USE_BACKREF_WITH_LEVEL 2331 int low, up, syn_allow, non_low = 0;
2349 if (c ==
')' || c ==
'(' || c ==
'|') {
2369 if (
PEND)
goto invalid;
2393 if (
PEND)
goto invalid;
2397 if (
PEND)
goto invalid;
2400 if (c !=
'}')
goto invalid;
2440 v = fetch_escaped_value(&p, end, env, &c);
2441 if (v < 0)
return v;
2443 c = ((c & 0xff) | 0x80);
2469 v = fetch_escaped_value(&p, end, env, &c);
2470 if (v < 0)
return v;
2481 c = conv_backslash_value(c, env);
2508 #ifdef USE_NAMED_GROUP 2510 # define ONIGENC_IS_CODE_NAME(enc, c) TRUE 2512 # define ONIGENC_IS_CODE_NAME(enc, c) ONIGENC_IS_CODE_WORD(enc, c) 2515 # ifdef USE_BACKREF_WITH_LEVEL 2524 int* rback_num,
int* rlevel)
2526 int r, sign, is_num, exist_level;
2536 is_num = exist_level = 0;
2540 end_code = get_name_end_code_point(start_code);
2555 else if (c ==
'-') {
2568 if (c == end_code || c ==
')' || c ==
'+' || c ==
'-') {
2587 if (r == 0 && c != end_code) {
2588 if (c ==
'+' || c ==
'-') {
2590 int flag = (c ==
'-' ? -1 : 1);
2601 *rlevel = (level * flag);
2621 else if (*rback_num == 0)
goto err;
2626 *rname_end = name_end;
2628 return (exist_level ? 1 : 0);
2643 UChar** rname_end,
ScanEnv* env,
int* rback_num,
int ref)
2645 int r, is_num, sign;
2655 end_code = get_name_end_code_point(start_code);
2678 else if (c ==
'-') {
2698 if (c == end_code || c ==
')') {
2726 if (c != end_code) {
2735 else if (*rback_num == 0) {
2743 *rname_end = name_end;
2752 if (c == end_code || c ==
')')
2766 UChar** rname_end,
ScanEnv* env,
int* rback_num,
int ref)
2768 int r, is_num, sign;
2779 end_code = get_name_end_code_point(start_code);
2781 *rname_end = name_end = end;
2798 else if (c ==
'-') {
2812 if (c == end_code || c ==
')')
break;
2816 if (r == 0 && c != end_code) {
2824 else if (*rback_num == 0) {
2830 *rname_end = name_end;
2844 onig_syntax_warn(
ScanEnv *env,
const char *fmt, ...)
2848 va_start(args, fmt);
2851 (
const UChar *)fmt, args);
2859 (*onig_warn)((
char* )buf);
2870 onig_syntax_warn(env,
"character class has '%s' without escape", c);
2880 onig_syntax_warn(env,
"regular expression has '%s' without escape", c);
2896 onig_syntax_warn(env,
"character class has duplicated range");
2901 UNKNOWN_ESC_WARN(
ScanEnv *env,
int c)
2904 onig_syntax_warn(env,
"Unknown escape \\%c is ignored", c);
2918 q = p +
enclen(enc, p, to);
2920 for (i = 1; i < n && q < to; i++) {
2922 if (x != s[i])
break;
2953 q = p +
enclen(enc, p, to);
2955 for (i = 1; i < n && q < to; i++) {
2957 if (x != s[i])
break;
2960 if (i >= n)
return 1;
2965 if (x == bad)
return 0;
2966 else if (x ==
MC_ESC(syn)) in_esc = 1;
2999 else if (c ==
'-') {
3002 else if (c ==
MC_ESC(syn)) {
3015 tok->
u.
prop.not = 0;
3020 tok->
u.
prop.not = 1;
3025 tok->
u.
prop.not = 0;
3030 tok->
u.
prop.not = 1;
3035 tok->
u.
prop.not = 0;
3040 tok->
u.
prop.not = 1;
3046 tok->
u.
prop.not = 0;
3052 tok->
u.
prop.not = 1;
3064 tok->
u.
prop.not = (c ==
'P' ? 1 : 0);
3069 tok->
u.
prop.not = (tok->
u.
prop.not == 0 ? 1 : 0);
3076 onig_syntax_warn(env,
"invalid Unicode Property \\%c", c);
3086 num = scan_unsigned_hexadecimal_number(&p, end, 0, 8, enc);
3106 num = scan_unsigned_hexadecimal_number(&p, end, 0, 2, enc);
3122 num = scan_unsigned_hexadecimal_number(&p, end, 4, 4, enc);
3140 num = scan_unsigned_octal_number(&p, end, 11, enc);
3162 case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
3166 num = scan_unsigned_octal_number(&p, end, 3, enc);
3179 num = fetch_escaped_value(&p, end, env, &c2);
3180 if (num < 0)
return num;
3188 else if (c ==
'[') {
3193 if (str_exist_check_with_esc(send, 2, p, end,
3208 CC_ESC_WARN(env, (
UChar* )
"[");
3212 else if (c ==
'&') {
3225 #ifdef USE_NAMED_GROUP 3240 # ifdef USE_BACKREF_WITH_LEVEL 3242 r = fetch_name_with_level(c, &p, end, &name_end,
3243 env, &back_num, &tok->
u.
backref.level);
3244 if (r == 1) tok->
u.
backref.exist_level = 1;
3245 else tok->
u.
backref.exist_level = 0;
3247 r = fetch_name(&p, end, &name_end, env, &back_num, 1);
3249 if (r < 0)
return r;
3251 if (back_num != 0) {
3259 if (back_num > env->
num_mem ||
3277 for (i = 0; i < num; i++) {
3278 if (backs[i] > env->
num_mem ||
3379 r = fetch_range_quantifier(&p, end, tok, env);
3380 if (r < 0)
return r;
3381 if (r == 0)
goto greedy_check;
3384 goto possessive_check;
3410 tok->
u.
prop.not = 0;
3417 tok->
u.
prop.not = 1;
3436 #ifdef USE_WORD_BEGIN_END 3456 tok->
u.
prop.not = 0;
3463 tok->
u.
prop.not = 1;
3470 tok->
u.
prop.not = 0;
3477 tok->
u.
prop.not = 1;
3484 tok->
u.
prop.not = 0;
3491 tok->
u.
prop.not = 1;
3536 num = scan_unsigned_hexadecimal_number(&p, end, 0, 8, enc);
3554 num = scan_unsigned_hexadecimal_number(&p, end, 0, 2, enc);
3570 num = scan_unsigned_hexadecimal_number(&p, end, 4, 4, enc);
3588 num = scan_unsigned_octal_number(&p, end, 11, enc);
3608 case '1':
case '2':
case '3':
case '4':
3609 case '5':
case '6':
case '7':
case '8':
case '9':
3618 (num <= env->num_mem || num <= 9)) {
3628 #ifdef USE_BACKREF_WITH_LEVEL 3635 if (c ==
'8' || c ==
'9') {
3646 num = scan_unsigned_octal_number(&p, end, (c ==
'0' ? 2:3), enc);
3655 else if (c !=
'0') {
3660 #ifdef USE_NAMED_GROUP 3664 if (c ==
'<' || c ==
'\'') {
3665 r = fetch_named_backref_token(c, tok, &p, end, env);
3666 if (r < 0)
return r;
3670 onig_syntax_warn(env,
"invalid back reference");
3676 #if defined(USE_SUBEXP_CALL) || defined(USE_NAMED_GROUP) 3678 # ifdef USE_NAMED_GROUP 3682 r = fetch_named_backref_token(c, tok, &p, end, env);
3683 if (r < 0)
return r;
3689 # ifdef USE_SUBEXP_CALL 3692 if (c ==
'<' || c ==
'\'') {
3693 int gnum = -1, rel = 0;
3700 if (
PPEEK_IS(get_name_end_code_point(c))) {
3706 else if (cnext ==
'+') {
3712 r = fetch_name((
OnigCodePoint )c, &p, end, &name_end, env, &gnum, 1);
3713 if (r < 0)
return r;
3717 tok->
u.
call.name = prev;
3718 tok->
u.
call.name_end = name_end;
3719 tok->
u.
call.gnum = gnum;
3720 tok->
u.
call.rel = rel;
3723 onig_syntax_warn(env,
"invalid subexp call");
3743 tok->
u.
prop.not = (c ==
'P' ? 1 : 0);
3748 tok->
u.
prop.not = (tok->
u.
prop.not == 0 ? 1 : 0);
3755 onig_syntax_warn(env,
"invalid Unicode Property \\%c", c);
3782 num = fetch_escaped_value(&p, end, env, &c2);
3783 if (num < 0)
return num;
3800 #ifdef USE_VARIABLE_META_CHARS 3808 goto zero_or_one_time;
3810 goto one_or_more_time;
3821 #ifdef USE_VARIABLE_META_CHARS 3829 #ifdef USE_VARIABLE_META_CHARS 3840 #ifdef USE_VARIABLE_META_CHARS 3851 #ifdef USE_VARIABLE_META_CHARS 3862 r = fetch_range_quantifier(&p, end, tok, env);
3863 if (r < 0)
return r;
3864 if (r == 0)
goto greedy_check;
3867 goto possessive_check;
3892 if (c ==
')')
break;
3897 #ifdef USE_PERL_SUBEXP_CALL 3907 if (c ==
'R' || c ==
'0') {
3911 name_end = name = p;
3921 r = fetch_name((
OnigCodePoint )
'(', &p, end, &name_end, env, &gnum, numref);
3922 if (r < 0)
return r;
3927 tok->
u.
call.name_end = name_end;
3928 tok->
u.
call.gnum = gnum;
3929 tok->
u.
call.rel = 0;
3932 else if ((c ==
'-' || c ==
'+') &&
3946 r = fetch_name((
OnigCodePoint )
'(', &p, end, &name_end, env, &gnum, 1);
3947 if (r < 0)
return r;
3951 tok->
u.
call.name_end = name_end;
3952 tok->
u.
call.gnum = gnum;
3953 tok->
u.
call.rel = 1;
3958 #ifdef USE_CAPITAL_P_NAMED_GROUP 3970 r = fetch_named_backref_token((
OnigCodePoint )
'(', tok, &p, end, env);
3971 if (r < 0)
return r;
3974 else if (c ==
'>') {
3976 r = fetch_name((
OnigCodePoint )
'(', &p, end, &name_end, env, &gnum, 0);
3977 if (r < 0)
return r;
3981 tok->
u.
call.name_end = name_end;
3982 tok->
u.
call.gnum = gnum;
3983 tok->
u.
call.rel = 0;
4021 CLOSE_BRACKET_WITHOUT_ESC_WARN(env, (
UChar* )
"]");
4036 case ' ':
case '\t':
case '\n':
case '\r':
case '\f':
4047 #ifdef USE_VARIABLE_META_CHARS 4055 add_ctype_to_cc_by_range(
CClassNode* cc,
int ctype ARG_UNUSED,
int not,
4065 for (i = 0; i < n; i++) {
4070 r = add_code_range_to_buf(&(cc->
mbuf), env, j,
4072 if (r != 0)
return r;
4083 for ( ; i < n; i++) {
4084 r = add_code_range_to_buf(&(cc->
mbuf), env,
4087 if (r != 0)
return r;
4093 for (i = 0; i < n; i++) {
4103 for (j = prev; j < sb_out; j++) {
4110 for (i = 0; i < n; i++) {
4112 r = add_code_range_to_buf(&(cc->
mbuf), env, prev,
4114 if (r != 0)
return r;
4118 if (prev < 0x7fffffff) {
4119 r = add_code_range_to_buf(&(cc->
mbuf), env, prev, 0x7fffffff);
4120 if (r != 0)
return r;
4128 add_ctype_to_cc(
CClassNode* cc,
int ctype,
int not,
int ascii_range,
ScanEnv* env)
4140 initialize_cclass(&ccwork);
4141 r = add_ctype_to_cc_by_range(&ccwork, ctype, not, env, sb_out,
4149 initialize_cclass(&ccascii);
4151 r = add_code_range(&(ccascii.
mbuf), env, 0x00, 0x7F);
4154 bitset_set_range(env, ccascii.
bs, 0x00, 0x7F);
4158 r = and_cclass(&ccwork, &ccascii, env);
4163 r = or_cclass(cc, &ccwork, env);
4169 r = add_ctype_to_cc_by_range(cc, ctype, not, env, sb_out, ranges);
4218 for (c = 0; c < maxcode; c++) {
4229 for (c = 0; c < maxcode; c++) {
4258 #define POSIX_BRACKET_CHECK_LIMIT_LENGTH 20 4259 #define POSIX_BRACKET_NAME_MIN_LEN 4 4293 goto not_posix_bracket;
4297 for (pb = PBS; pb < PBS +
numberof(PBS); pb++) {
4303 r = add_ctype_to_cc(cc, pb->
ctype, not, ascii_range, env);
4304 if (r != 0)
return r;
4310 r = add_ctype_to_cc(asc_cc, pb->
ctype, not, ascii_range, env);
4311 if (r != 0)
return r;
4323 while (!
PEND && ((c =
PPEEK) !=
':') && c !=
']') {
4327 if (c ==
':' && !
PEND) {
4345 UChar *prev, *start, *p = *src;
4360 else if (c ==
'(' || c ==
')' || c ==
'{' || c ==
'|') {
4379 ctype = fetch_char_property_to_ctype(src, end, env);
4380 if (ctype < 0)
return ctype;
4382 *np = node_new_cclass();
4385 r = add_ctype_to_cc(cc, ctype, 0, 0, env);
4386 if (r != 0)
return r;
4391 r = cclass_case_fold(np, cc, cc, env);
4427 r = add_code_range(&(cc->
mbuf), env, *vs, *vs);
4428 if (r < 0)
return r;
4430 r = add_code_range0(&(asc_cc->
mbuf), env, *vs, *vs, 0);
4431 if (r < 0)
return r;
4444 int* vs_israw,
int v_israw,
4458 r = add_code_range(&(cc->
mbuf), env, *vs, *vs);
4459 if (r < 0)
return r;
4461 r = add_code_range0(&(asc_cc->
mbuf), env, *vs, *vs, 0);
4462 if (r < 0)
return r;
4468 if (intype == *type) {
4470 if (*vs > 0xff || v > 0xff)
4479 bitset_set_range(env, cc->
bs, (
int )*vs, (
int )v);
4481 bitset_set_range(env, asc_cc->
bs, (
int )*vs, (
int )v);
4484 r = add_code_range(&(cc->
mbuf), env, *vs, v);
4485 if (r < 0)
return r;
4487 r = add_code_range0(&(asc_cc->
mbuf), env, *vs, v, 0);
4488 if (r < 0)
return r;
4502 bitset_set_range(env, cc->
bs, (
int )*vs, (
int )(v < 0xff ? v : 0xff));
4504 if (r < 0)
return r;
4506 bitset_set_range(env, asc_cc->
bs, (
int )*vs, (
int )(v < 0xff ? v : 0xff));
4508 if (r < 0)
return r;
4529 *vs_israw = v_israw;
4546 if (ignore_escaped && in_esc) {
4551 if (code == c)
return 1;
4562 int r,
neg,
len, fetched, and_start;
4573 int val_israw, in_israw;
4580 r = fetch_token_in_cc(tok, src, end, env);
4583 r = fetch_token_in_cc(tok, src, end, env);
4589 if (r < 0)
return r;
4595 CC_ESC_WARN(env, (
UChar* )
"]");
4599 *np = node = node_new_cclass();
4604 *asc_np = asc_node = node_new_cclass();
4643 int i, base = tok->
base;
4647 r = fetch_token_in_cc(tok, &p, end, env);
4648 if (r < 0)
goto err;
4668 for (i = 1; i <
len; i++) {
4669 (void)fetch_token_in_cc(tok, &p, end, env);
4704 r = next_state_val(cc, asc_cc, &vs, v, &val_israw, in_israw, in_type, &val_type,
4706 if (r != 0)
goto err;
4710 r = parse_posix_bracket(cc, asc_cc, &p, end, env);
4711 if (r < 0)
goto err;
4713 CC_ESC_WARN(env, (
UChar* )
"[");
4723 r = add_ctype_to_cc(cc, tok->
u.
prop.ctype, tok->
u.
prop.not,
4725 if (r != 0)
return r;
4728 r = add_ctype_to_cc(asc_cc, tok->
u.
prop.ctype, tok->
u.
prop.not,
4730 if (r != 0)
return r;
4734 r = next_state_class(cc, asc_cc, &vs, &val_type, &state, env);
4735 if (r != 0)
goto err;
4742 ctype = fetch_char_property_to_ctype(&p, end, env);
4743 if (ctype < 0)
return ctype;
4744 r = add_ctype_to_cc(cc, ctype, tok->
u.
prop.not, 0, env);
4745 if (r != 0)
return r;
4748 r = add_ctype_to_cc(asc_cc, ctype, tok->
u.
prop.not, 0, env);
4749 if (r != 0)
return r;
4757 r = fetch_token_in_cc(tok, &p, end, env);
4758 if (r < 0)
goto err;
4767 CC_ESC_WARN(env, (
UChar* )
"-");
4777 r = fetch_token_in_cc(tok, &p, end, env);
4778 if (r < 0)
goto err;
4782 CC_ESC_WARN(env, (
UChar* )
"-");
4787 CC_ESC_WARN(env, (
UChar* )
"-");
4791 r = fetch_token_in_cc(tok, &p, end, env);
4792 if (r < 0)
goto err;
4796 CC_ESC_WARN(env, (
UChar* )
"-");
4801 CC_ESC_WARN(env, (
UChar* )
"-");
4811 Node *anode, *aasc_node;
4814 r = parse_char_class(&anode, &aasc_node, tok, &p, end, env);
4817 r = or_cclass(cc, acc, env);
4821 r = or_cclass(asc_cc, acc, env);
4825 if (r != 0)
goto err;
4832 r = next_state_val(cc, asc_cc, &vs, 0, &val_israw, 0, val_type,
4833 &val_type, &state, env);
4834 if (r != 0)
goto err;
4841 r = and_cclass(prev_cc, cc, env);
4842 if (r != 0)
goto err;
4843 bbuf_free(cc->
mbuf);
4845 r = and_cclass(asc_prev_cc, asc_cc, env);
4846 if (r != 0)
goto err;
4847 bbuf_free(asc_cc->
mbuf);
4854 asc_prev_cc = asc_cc;
4855 asc_cc = &asc_work_cc;
4858 initialize_cclass(cc);
4860 initialize_cclass(asc_cc);
4877 r = fetch_token_in_cc(tok, &p, end, env);
4878 if (r < 0)
goto err;
4883 r = next_state_val(cc, asc_cc, &vs, 0, &val_israw, 0, val_type,
4884 &val_type, &state, env);
4885 if (r != 0)
goto err;
4889 r = and_cclass(prev_cc, cc, env);
4890 if (r != 0)
goto err;
4891 bbuf_free(cc->
mbuf);
4894 r = and_cclass(asc_prev_cc, asc_cc, env);
4895 if (r != 0)
goto err;
4896 bbuf_free(asc_cc->
mbuf);
4897 asc_cc = asc_prev_cc;
4919 if (is_empty == 0) {
4920 #define NEWLINE_CODE 0x0a 4927 if (r < 0)
goto err;
4938 bbuf_free(cc->
mbuf);
4940 bbuf_free(asc_cc->
mbuf);
4957 #ifdef USE_NAMED_GROUP 4977 r = fetch_token(tok, &p, end, env);
4978 if (r < 0)
return r;
4979 r = parse_subexp(np, tok, term, &p, end, env);
4980 if (r < 0)
return r;
5003 #ifdef USE_NAMED_GROUP 5012 # ifdef USE_CAPITAL_P_NAMED_GROUP 5017 if (c ==
'<')
goto named_group1;
5031 #ifdef USE_NAMED_GROUP 5043 # ifdef USE_CAPTURE_HISTORY 5047 r = fetch_name((
OnigCodePoint )c, &p, end, &name_end, env, &num, 0);
5048 if (r < 0)
return r;
5050 num = scan_env_add_mem_entry(env);
5051 if (num < 0)
return num;
5055 r = name_add(env->
reg, name, name_end, num, env);
5056 if (r != 0)
return r;
5057 *np = node_new_enclose_memory(env->
option, 1);
5060 if (list_capture != 0)
5075 #ifdef USE_CAPTURE_HISTORY 5078 # ifdef USE_NAMED_GROUP 5082 if (c ==
'<' || c ==
'\'') {
5089 *np = node_new_enclose_memory(env->
option, 0);
5091 num = scan_env_add_mem_entry(env);
5092 if (num < 0)
return num;
5113 r = fetch_name((
OnigCodePoint )
'(', &p, end, &name_end, env, &num, 1);
5114 if (r < 0)
return r;
5129 #ifdef USE_NAMED_GROUP 5130 else if (c ==
'<' || c ==
'\'') {
5132 r = fetch_named_backref_token(c, tok, &p, end, env);
5133 if (r < 0)
return r;
5197 #ifdef USE_POSIXLINE_OPTION 5200 case '-':
case 'i':
case 'm':
case 's':
case 'x':
5201 case 'a':
case 'd':
case 'l':
case 'u':
5211 case '-': neg = 1;
break;
5232 #ifdef USE_POSIXLINE_OPTION 5290 *np = node_new_option(option);
5295 else if (c ==
':') {
5299 r = fetch_token(tok, &p, end, env);
5304 r = parse_subexp(&target, tok, term, &p, end, env);
5306 if (r < 0)
return r;
5307 *np = node_new_option(option);
5328 *np = node_new_enclose_memory(env->
option, 0);
5330 num = scan_env_add_mem_entry(env);
5331 if (num < 0)
return num;
5336 r = fetch_token(tok, &p, end, env);
5337 if (r < 0)
return r;
5338 r = parse_subexp(&target, tok, term, &p, end, env);
5345 NANCHOR(*np)->target = target;
5350 r = scan_env_set_mem_node(env,
NENCLOSE(*np)->regnum, *np);
5351 if (r != 0)
return r;
5356 work1 = node_new_empty();
5378 static const char*
const PopularQStr[] = {
5379 "?",
"*",
"+",
"??",
"*?",
"+?" 5382 static const char*
const ReduceQStr[] = {
5383 "",
"",
"*",
"*?",
"??",
"+ and ??",
"+? and ?" 5396 switch (
NTYPE(target)) {
5400 if (str_node_can_be_split(sn, env->
enc)) {
5401 Node* n = str_node_split_last_char(sn, env->
enc);
5414 int nestq_num = popular_quantifier_num(qn);
5415 int targetq_num = popular_quantifier_num(qnt);
5417 #ifdef USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR 5418 if (nestq_num >= 0 && targetq_num >= 0 &&
5420 switch (ReduceTypeTable[targetq_num][nestq_num]) {
5426 onig_syntax_warn(env,
"regular expression has redundant nested repeat operator '%s'",
5427 PopularQStr[targetq_num]);
5434 onig_syntax_warn(env,
"nested repeat operator '%s' and '%s' was replaced with '%s' in regular expression",
5435 PopularQStr[targetq_num], PopularQStr[nestq_num],
5436 ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]);
5445 if (targetq_num >= 0) {
5446 if (nestq_num >= 0) {
5450 else if (targetq_num == 1 || targetq_num == 2) {
5470 #ifndef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS 5478 bitset_invert(cc->
bs);
5481 r = not_code_range_buf(enc, cc->
mbuf, &tbuf);
5482 if (r != 0)
return r;
5484 bbuf_free(cc->
mbuf);
5505 int to_len,
void* arg)
5529 add_flag = !add_flag;
5534 #ifdef CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS 5539 r = add_code_range0(&(cc->
mbuf), env, *to, *to, 0);
5540 if (r < 0)
return r;
5552 r = add_code_range0(&(cc->
mbuf), env, *to, *to, 0);
5553 if (r < 0)
return r;
5577 for (i = 0; i < to_len; i++) {
5618 i_apply_case_fold, &iarg);
5648 if (num1 < 0)
return num1;
5650 if (num2 < 0)
return num2;
5651 left = node_new_str_raw(buf, buf + num1 + num2);
5655 right = node_new_cclass();
5659 r = add_code_range(&(cc->
mbuf), env, 0x0A, 0x0D);
5660 if (r != 0)
goto err;
5663 bitset_set_range(env, cc->
bs, 0x0A, 0x0D);
5669 r = add_code_range(&(cc->
mbuf), env, 0x85, 0x85);
5670 if (r != 0)
goto err;
5671 r = add_code_range(&(cc->
mbuf), env, 0x2028, 0x2029);
5672 if (r != 0)
goto err;
5699 propname2ctype(
ScanEnv* env,
const char* propname)
5703 name, name +
strlen(propname));
5708 node_extended_grapheme_cluster(
Node** np,
ScanEnv* env)
5722 #ifdef USE_UNICODE_PROPERTIES 5727 int extend = propname2ctype(env,
"Grapheme_Cluster_Break=Extend");
5734 np1 = node_new_cclass();
5737 r = add_ctype_to_cc(cc, extend, 0, 0, env);
5738 if (r != 0)
goto err;
5739 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=SpacingMark"), 0, 0, env);
5740 if (r != 0)
goto err;
5741 r = add_code_range(&(cc->
mbuf), env, 0x200D, 0x200D);
5742 if (r != 0)
goto err;
5746 NQTFR(tmp)->target = np1;
5756 np1 = node_new_cclass();
5759 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=Control"), 1, 0, env);
5760 if (r != 0)
goto err;
5763 r = add_code_range(&pbuf1, env, 0x0a, 0x0a);
5764 if (r != 0)
goto err;
5765 r = add_code_range(&pbuf1, env, 0x0d, 0x0d);
5766 if (r != 0)
goto err;
5767 r = and_code_range_buf(cc->
mbuf, 0, pbuf1, 1, &pbuf2, env);
5774 bbuf_free(cc->
mbuf);
5795 np1 = node_new_cclass();
5798 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=T"), 0, 0, env);
5799 if (r != 0)
goto err;
5803 NQTFR(tmp)->target = np1;
5812 np1 = node_new_cclass();
5815 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=L"), 0, 0, env);
5816 if (r != 0)
goto err;
5820 NQTFR(tmp)->target = np1;
5829 np1 = node_new_cclass();
5832 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=T"), 0, 0, env);
5833 if (r != 0)
goto err;
5837 NQTFR(tmp)->target = np1;
5845 np1 = node_new_cclass();
5848 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=LVT"), 0, 0, env);
5849 if (r != 0)
goto err;
5851 tmp = node_new_list(np1, list2);
5856 np1 = node_new_cclass();
5859 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=L"), 0, 0, env);
5860 if (r != 0)
goto err;
5864 NQTFR(tmp)->target = np1;
5867 tmp = node_new_list(np1, list2);
5878 np1 = node_new_cclass();
5881 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=T"), 0, 0, env);
5882 if (r != 0)
goto err;
5886 NQTFR(tmp)->target = np1;
5894 np1 = node_new_cclass();
5897 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=V"), 0, 0, env);
5898 if (r != 0)
goto err;
5902 NQTFR(tmp)->target = np1;
5905 tmp = node_new_list(np1, list2);
5910 np1 = node_new_cclass();
5913 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=LV"), 0, 0, env);
5914 if (r != 0)
goto err;
5916 tmp = node_new_list(np1, list2);
5921 np1 = node_new_cclass();
5924 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=L"), 0, 0, env);
5925 if (r != 0)
goto err;
5929 NQTFR(tmp)->target = np1;
5932 tmp = node_new_list(np1, list2);
5943 np1 = node_new_cclass();
5946 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=T"), 0, 0, env);
5947 if (r != 0)
goto err;
5951 NQTFR(tmp)->target = np1;
5959 np1 = node_new_cclass();
5962 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=V"), 0, 0, env);
5963 if (r != 0)
goto err;
5967 NQTFR(tmp)->target = np1;
5970 tmp = node_new_list(np1, list2);
5975 np1 = node_new_cclass();
5978 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=L"), 0, 0, env);
5979 if (r != 0)
goto err;
5983 NQTFR(tmp)->target = np1;
5986 tmp = node_new_list(np1, list2);
6000 np1 = node_new_cclass();
6003 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=E_Modifier"), 0, 0, env);
6004 if (r != 0)
goto err;
6006 tmp = node_new_quantifier(0, 1, 0);
6008 NQTFR(tmp)->target = np1;
6016 np1 = node_new_cclass();
6019 r = add_ctype_to_cc(cc, extend, 0, 0, env);
6020 if (r != 0)
goto err;
6024 NQTFR(tmp)->target = np1;
6027 tmp = node_new_list(np1, list2);
6032 np1 = node_new_cclass();
6035 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=E_Base_GAZ"), 0, 0, env);
6036 if (r != 0)
goto err;
6038 tmp = node_new_list(np1, list2);
6049 np1 = node_new_cclass();
6052 r = add_ctype_to_cc(cc, extend, 0, 0, env);
6053 if (r != 0)
goto err;
6057 NQTFR(tmp)->target = np1;
6065 np1 = node_new_cclass();
6085 r = add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges);
6086 if (r != 0)
goto err;
6088 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=Glue_After_Zwj"), 0, 0, env);
6089 if (r != 0)
goto err;
6091 tmp = node_new_list(np1, list2);
6105 if (r < 0)
goto err;
6106 np1 = node_new_str_raw(buf, buf + r);
6109 tmp = node_new_quantifier(0, 1, 0);
6111 NQTFR(tmp)->target = np1;
6119 np1 = node_new_cclass();
6130 r = add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges);
6131 if (r != 0)
goto err;
6134 tmp = node_new_list(np1, list2);
6151 if (r < 0)
goto err;
6152 np1 = node_new_str_raw(buf, buf + r);
6155 tmp = node_new_list(np1, list2);
6162 NQTFR(tmp)->target = list2;
6172 np1 = node_new_cclass();
6175 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=E_Modifier"), 0, 0, env);
6176 if (r != 0)
goto err;
6178 tmp = node_new_quantifier(0, 1, 0);
6180 NQTFR(tmp)->target = np1;
6183 tmp = node_new_list(np1, list2);
6189 np1 = node_new_cclass();
6192 r = add_ctype_to_cc(cc, extend, 0, 0, env);
6193 if (r != 0)
goto err;
6197 NQTFR(tmp)->target = np1;
6200 tmp = node_new_list(np1, list2);
6206 np1 = node_new_cclass();
6221 r = add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges);
6222 if (r != 0)
goto err;
6224 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=E_Base"), 0, 0, env);
6225 if (r != 0)
goto err;
6226 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=E_Base_GAZ"), 0, 0, env);
6227 if (r != 0)
goto err;
6229 tmp = node_new_list(np1, list2);
6244 np1 = node_new_cclass();
6247 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=E_Modifier"), 0, 0, env);
6248 if (r != 0)
goto err;
6250 tmp = node_new_quantifier(0, 1, 0);
6252 NQTFR(tmp)->target = np1;
6260 np1 = node_new_cclass();
6263 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=Glue_After_Zwj"), 0, 0, env);
6264 if (r != 0)
goto err;
6265 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=E_Base_GAZ"), 0, 0, env);
6266 if (r != 0)
goto err;
6268 tmp = node_new_list(np1, list2);
6274 if (r < 0)
goto err;
6275 np1 = node_new_str_raw(buf, buf + r);
6278 tmp = node_new_list(np1, list2);
6289 np1 = node_new_cclass();
6292 r = add_code_range(&(cc->
mbuf), env, 0x1F1E6, 0x1F1FF);
6293 if (r != 0)
goto err;
6295 tmp = node_new_quantifier(2, 2, 0);
6297 NQTFR(tmp)->target = np1;
6300 tmp = node_new_list(np1, list2);
6310 tmp = node_new_list(alt, list);
6316 np1 = node_new_cclass();
6319 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=Prepend"), 0, 0, env);
6320 if (r != 0)
goto err;
6324 NQTFR(tmp)->target = np1;
6327 tmp = node_new_list(np1, list);
6333 np1 = node_new_anychar();
6338 tmp = node_new_option(option);
6350 if (r < 0)
goto err;
6351 np1 = node_new_str_raw(buf, buf + r);
6354 tmp = node_new_quantifier(0, 1, 0);
6356 NQTFR(tmp)->target = np1;
6364 np1 = node_new_cclass();
6367 r = add_ctype_to_cc(cc, propname2ctype(env,
"Grapheme_Cluster_Break=Prepend"), 0, 0, env);
6368 if (r != 0)
goto err;
6372 NQTFR(tmp)->target = np1;
6375 tmp = node_new_list(np1, list2);
6394 np1 = node_new_anychar();
6399 tmp = node_new_option(option);
6411 if (r < 0)
goto err;
6414 if (r < 0)
goto err;
6415 np1 = node_new_str_raw(buf, buf + num1 + r);
6429 #ifdef USE_UNICODE_PROPERTIES 6434 *np = node_new_option(option);
6456 countbits(
unsigned int bits)
6458 bits = (bits & 0x55555555) + ((bits >> 1) & 0x55555555);
6459 bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333);
6460 bits = (bits & 0x0f0f0f0f) + ((bits >> 4) & 0x0f0f0f0f);
6461 bits = (bits & 0x00ff00ff) + ((bits >> 8) & 0x00ff00ff);
6462 return (bits & 0x0000ffff) + ((bits >>16) & 0x0000ffff);
6480 if ((n == 1) && (data[0] == data[1])) {
6497 if (((b1 & (b1 - 1)) == 0) && (c == not_found)) {
6505 if (c != not_found) {
6519 int r,
len, group = 0;
6527 switch (tok->
type) {
6531 *np = node_new_empty();
6537 if (r < 0)
return r;
6538 if (r == 1) group = 1;
6544 r = fetch_token(tok, src, end, env);
6549 r = parse_subexp(&target, tok, term, src, end, env);
6564 if (tok->
escaped)
goto tk_raw_byte;
6569 r = node_linebreak(np, env);
6570 if (r < 0)
return r;
6574 r = node_extended_grapheme_cluster(np, env);
6575 if (r < 0)
return r;
6586 *np = node_new_str(tok->
backp, *src);
6591 r = fetch_token(tok, src, end, env);
6592 if (r < 0)
return r;
6596 #ifndef NUMBERED_CHAR_IS_NOT_CASE_AMBIG 6598 r = node_str_cat_codepoint(*np, env->
enc, tok->
u.
code);
6604 if (r < 0)
return r;
6616 *np = node_new_str_raw_char((
UChar )tok->
u.
c);
6622 r = fetch_token(tok, src, end, env);
6628 r = fetch_token(tok, src, end, env);
6629 if (r < 0)
return r;
6632 #ifdef USE_PAD_TO_SHORT_BYTE_CHAR 6636 (void )node_str_head_pad(
NSTR(*np), rem, (
UChar )0);
6646 r = node_str_cat_char(*np, (
UChar )tok->
u.
c);
6647 if (r < 0)
return r;
6656 *np = node_new_empty();
6658 r = node_str_cat_codepoint(*np, env->
enc, tok->
u.
code);
6659 if (r != 0)
return r;
6660 #ifdef NUMBERED_CHAR_IS_NOT_CASE_AMBIG 6671 UChar *qstart, *qend, *nextp;
6676 qend = find_str_position(end_op, 2, qstart, end, &nextp, env->
enc);
6680 *np = node_new_str(qstart, qend);
6688 switch (tok->
u.
prop.ctype) {
6690 *np = node_new_ctype(tok->
u.
prop.ctype, tok->
u.
prop.not,
6701 *np = node_new_cclass();
6704 r = add_ctype_to_cc(cc, tok->
u.
prop.ctype, 0,
6706 if (r != 0)
return r;
6719 r = parse_char_property(np, tok, src, end, env);
6720 if (r != 0)
return r;
6729 r = parse_char_class(np, &asc_node, tok, src, end, env);
6736 if (is_onechar_cclass(cc, &code)) {
6739 *np = node_new_empty();
6741 r = node_str_cat_codepoint(*np, env->
enc, code);
6742 if (r != 0)
return r;
6746 r = cclass_case_fold(np, cc,
NCCLASS(asc_node), env);
6757 *np = node_new_anychar();
6762 *np = node_new_anychar();
6766 NQTFR(qn)->target = *np;
6772 *np = node_new_backref(len,
6783 #ifdef USE_SUBEXP_CALL 6786 int gnum = tok->
u.
call.gnum;
6788 if (gnum < 0 || tok->u.call.rel != 0) {
6789 if (gnum > 0) gnum--;
6794 *np = node_new_call(tok->
u.
call.name, tok->
u.
call.name_end, gnum);
6813 *np = node_new_empty();
6829 r = fetch_token(tok, src, end, env);
6830 if (r < 0)
return r;
6837 qn = node_new_quantifier(tok->
u.
repeat.lower, tok->
u.
repeat.upper,
6841 r = set_quantifier(qn, *targetp, group, env);
6847 if (tok->
u.
repeat.possessive != 0) {
6867 *targetp = node_new_list(*targetp,
NULL);
6872 tmp =
NCDR(*targetp) = node_new_list(qn,
NULL);
6877 targetp = &(
NCAR(tmp));
6891 Node *node, **headp;
6894 r = parse_exp(&node, tok, term, src, end, env);
6904 *top = node_new_list(node,
NULL);
6905 headp = &(
NCDR(*top));
6907 r = parse_exp(&node, tok, term, src, end, env);
6916 headp = &(
NCDR(node));
6919 *headp = node_new_list(node,
NULL);
6920 headp = &(
NCDR(*headp));
6934 Node *node, **headp;
6940 r = parse_branch(&node, tok, term, src, end, env);
6951 headp = &(
NCDR(*top));
6953 r = fetch_token(tok, src, end, env);
6954 if (r < 0)
return r;
6955 r = parse_branch(&node, tok, term, src, end, env);
6962 headp = &(
NCDR(*headp));
6987 r = fetch_token(&tok, src, end, env);
6988 if (r < 0)
return r;
6989 r = parse_subexp(top, &tok,
TK_EOT, src, end, env);
6990 if (r < 0)
return r;
6992 #ifdef USE_SUBEXP_CALL 6997 np = node_new_enclose_memory(env->
option, 0);
7001 r = scan_env_set_mem_node(env, num, np);
7019 #ifdef USE_NAMED_GROUP 7023 scan_env_clear(env);
7033 p = (
UChar* )pattern;
7034 r = parse_regexp(root, &p, (
UChar* )end, env);
unsigned int OnigOptionType
#define ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS
#define NSTRING_SET_AMBIG(node)
void onig_scan_env_set_error_string(ScanEnv *env, int ecode ARG_UNUSED, UChar *arg, UChar *arg_end)
#define ONIGENC_APPLY_ALL_CASE_FOLD(enc, case_fold_flag, f, arg)
#define NCCLASS_SET_NOT(nd)
#define ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY
#define ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP
void onig_set_warn_func(OnigWarnFunc f)
#define NODE_STR_BUF_SIZE
#define ONIGENC_CODE_TO_MBCLEN(enc, code)
unsigned int OnigCodePoint
#define ONIG_REGION_NOTPOS
#define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf)
#define ONIGENC_MBC_MAXLEN(enc)
void rb_warn(const char *fmt,...)
int onig_foreach_name(regex_t *reg, int(*func)(const UChar *, const UChar *, int, int *, regex_t *, void *), void *arg)
#define IS_REPEAT_INFINITE(n)
#define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf)
int onig_node_str_cat(Node *node, const UChar *s, const UChar *end)
Node * onig_node_list_add(Node *list, Node *x)
#define IS_SYNTAX_BV(syn, bvm)
int onig_st_lookup_strend(hash_table_type *table, const UChar *str_key, const UChar *end_key, hash_data_type *value)
size_t strlen(const char *)
#define ONIGERR_TOO_MANY_CAPTURE_GROUPS
#define ONIG_SYN_OP_ESC_W_WORD
#define ONIGENC_IS_UNICODE(enc)
void onig_null_warn(const char *s ARG_UNUSED)
#define BBUF_WRITE_CODE_POINT(bbuf, pos, code)
#define ONIGERR_META_CODE_SYNTAX
#define ONIG_SYN_OP_ESC_D_DIGIT
#define ONIGERR_INVALID_BACKREF
#define ONIG_MAX_REPEAT_NUM
#define ANCHOR_WORD_BEGIN
#define ONIG_SYN_OP_VARIABLE_META_CHARACTERS
#define ONIG_SYN_OP_QMARK_ZERO_ONE
#define BITSET_SET_BIT(bs, pos)
#define NCCLASS_CLEAR_NOT(nd)
#define ONIG_SYN_OP_ESC_X_BRACE_HEX8
#define SCANENV_MEM_NODES(senv)
#define ONIGENC_CTYPE_ASCII
#define ONIGERR_UNDEFINED_GROUP_OPTION
#define ONIG_IS_OPTION_ON(options, option)
#define ONIGERR_INVALID_CODE_POINT_VALUE
int onig_names_free(regex_t *reg)
#define ANCHOR_BEGIN_LINE
#define IS_SYNTAX_OP(syn, opm)
int onig_node_str_set(Node *node, const UChar *s, const UChar *end)
#define ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME
#define IS_NCCLASS_NOT(nd)
#define ONIG_ENCODING_ASCII
#define ONIGERR_TOO_BIG_NUMBER
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
#define ONIG_SYN_OP2_ESC_G_SUBEXP_CALL
hash_table_type * onig_st_init_strend_table_with_size(st_index_t size)
#define ONIGERR_INVALID_GROUP_NAME
#define ONIGENC_CTYPE_ALPHA
#define ONIG_SYN_OP2_ESC_CAPITAL_C_BAR_CONTROL
#define IS_SINGLELINE(option)
#define GET_CODE_POINT(code, p)
#define ONIG_SYN_OP_ASTERISK_ZERO_INF
#define MC_ANYCHAR_ANYTIME(syn)
Node * onig_node_new_alt(Node *left, Node *right)
#define ONIG_SYN_OP_POSIX_BRACKET
int onig_st_insert_strend(hash_table_type *table, const UChar *str_key, const UChar *end_key, hash_data_type value)
#define BIT_STATUS_ON_AT_SIMPLE(stats, n)
#define SCANENV_MEMNODES_SIZE
#define ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS
#define ONIG_OPTION_IGNORECASE
#define ONIG_SYN_OP2_ESC_V_VTAB
#define ONIGENC_CTYPE_ALNUM
#define ONIG_OPTION_POSIX_BRACKET_ALL_RANGE
#define BBUF_MOVE_RIGHT(buf, from, to, n)
#define ONIGERR_MULTIPLEX_DEFINED_NAME
#define ANCHOR_BEGIN_POSITION
#define ONIGENC_PROPERTY_NAME_TO_CTYPE(enc, p, end)
#define ONIGERR_END_PATTERN_AT_ESCAPE
#define ONIGERR_CONTROL_CODE_SYNTAX
#define ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND
#define ONIG_SYN_OP_PLUS_ONE_INF
ONIG_EXTERN int onigenc_strlen(OnigEncoding enc, const OnigUChar *p, const OnigUChar *end)
#define ANCHOR_NOT_WORD_BOUND
#define MC_ONE_OR_MORE_TIME(syn)
#define ONIG_SYN_WARN_CC_DUP
#define ONIGENC_CTYPE_PRINT
#define ONIG_LAST_CODE_POINT
#define ONIG_SYN_OP_ESC_PLUS_ONE_INF
#define BIT_STATUS_CLEAR(stats)
#define ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF
#define ONIG_SYN_OP2_QMARK_TILDE_ABSENT
#define ONIGENC_CODE_TO_MBC_MAXLEN
#define ONIG_SYN_OP_ESC_C_CONTROL
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
#define ONIGENC_IS_CODE_NEWLINE(enc, code)
#define ONIGENC_IS_CODE_CTYPE(enc, code, ctype)
#define ONIG_INEFFECTIVE_META_CHAR
#define ONIG_SYN_OP_BRACKET_CC
#define ONIG_SYN_OP2_QMARK_LPAREN_CONDITION
#define IS_IGNORECASE(option)
struct OnigToken::@103::@106 backref
#define ONIG_OPTION_CAPTURE_GROUP
#define ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP
#define ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY
int onig_set_parse_depth_limit(unsigned int depth)
Node * mem_nodes_static[SCANENV_MEMNODES_SIZE]
#define POSIX_BRACKET_ENTRY_INIT(name, ctype)
#define ONIG_SYN_OP_VBAR_ALT
#define ONIG_SYN_OP2_ESC_H_XDIGIT
#define ONIGERR_MISMATCH_CODE_LENGTH_IN_CLASS_RANGE
int onig_number_of_names(const regex_t *reg)
OnigCaseFoldType case_fold_flag
#define ONIGERR_END_PATTERN_AT_META
#define ONIG_MAX_CAPTURE_GROUP_NUM
#define INIT_MULTI_BYTE_RANGE_SIZE
#define ONIGERR_EMPTY_RANGE_IN_CHAR_CLASS
int onig_strncmp(const UChar *s1, const UChar *s2, int n)
#define BBUF_INIT(buf, size)
#define ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT
#define SET_ENCLOSE_STATUS(node, f)
const OnigSyntaxType * syntax
#define ONIGERR_INVALID_CHAR_IN_GROUP_NAME
#define BACKREF_REL_TO_ABS(rel_no, env)
#define ONIGENC_IS_CODE_WORD(enc, code)
#define ONIGERR_END_PATTERN_AT_CONTROL
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT
#define POSIX_BRACKET_CHECK_LIMIT_LENGTH
#define ONIG_SYN_OP2_CCLASS_SET_OP
#define INIT_NAME_BACKREFS_ALLOC_NUM
#define ONIGERR_CHAR_CLASS_VALUE_AT_END_OF_RANGE
void(* OnigWarnFunc)(const char *s)
#define ONIGERR_END_PATTERN_IN_GROUP
#define BITSET_AT(bs, pos)
struct OnigToken::@103::@108 prop
#define ONIGERR_UNDEFINED_NAME_REFERENCE
#define ONIG_SYN_OP_ESC_QMARK_ZERO_ONE
#define ONIG_OPTION_WORD_BOUND_ALL_RANGE
#define ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT
#define IS_EXTEND(option)
void rb_compile_warn(const char *file, int line, const char *fmt,...)
#define ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS
#define CHECK_NULL_RETURN_MEMERR(p)
Node * onig_node_new_enclose(int type)
#define ONIGERR_UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE
void onig_set_verb_warn_func(OnigWarnFunc f)
#define ONIG_SYN_OP_DECIMAL_BACKREF
#define ONIGENC_CTYPE_SPACE
#define ONIGENC_MBC_MINLEN(enc)
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED
#define ONIG_SYN_USE_LEFT_MOST_NAMED_GROUP
#define ONIG_OPTION_DONT_CAPTURE_GROUP
#define is_invalid_quantifier_target(node)
#define ONIG_SYN_ALLOW_INTERVAL_LOW_ABBREV
#define ONIG_SYN_OP_BRACE_INTERVAL
#define ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR
#define ONIG_SYN_WARN_CC_OP_NOT_ESCAPED
#define BITSET_IS_EMPTY(bs, empty)
unsigned int onig_get_parse_depth_limit(void)
#define NSTRING_CLEAR_RAW(node)
#define XDIGITVAL(enc, code)
#define ONIG_SYN_OP2_ESC_CAPITAL_M_BAR_META
#define ONIG_OPTION_EXTEND
const OnigSyntaxType OnigSyntaxRuby
#define ONIG_OPTION_SINGLELINE
#define ONIG_SYN_STRICT_CHECK_BACKREF
#define ONIGENC_CTYPE_WORD
#define USE_BACKREF_WITH_LEVEL
#define ONIGENC_CTYPE_XDIGIT
#define BITSET_SET_BIT_CHKDUP(bs, pos)
#define BBUF_MOVE_LEFT_REDUCE(buf, from, to)
#define IS_WORD_BOUND_ALL_RANGE(option)
#define DEFAULT_PARSE_DEPTH_LIMIT
#define ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK
#define ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER
#define ONIGERR_UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS
ONIG_EXTERN OnigUChar * onigenc_get_prev_char_head(OnigEncoding enc, const OnigUChar *start, const OnigUChar *s, const OnigUChar *end)
int onig_name_to_group_numbers(regex_t *reg, const UChar *name, const UChar *name_end, int **nums)
int(* property_name_to_ctype)(const struct OnigEncodingTypeST *enc, const OnigUChar *p, const OnigUChar *end)
#define ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE
#define ONIGENC_MBC_TO_CODE(enc, p, end)
#define ONIG_SYN_OP_ESC_CONTROL_CHARS
#define SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2)
void onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, UChar *pat, UChar *pat_end, const UChar *fmt, va_list args)
#define ONIG_SYN_OP_QMARK_NON_GREEDY
#define ONIG_SYN_NOT_NEWLINE_IN_NEGATIVE_CC
#define ONIGERR_TOO_SHORT_MULTI_BYTE_STRING
unsigned char buf[MIME_BUF_SIZE]
int onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode *cc)
#define ONIGENC_CODE_RANGE_NUM(range)
#define ONIGENC_IS_SINGLEBYTE(enc)
#define ANCHOR_LOOK_BEHIND_NOT
BitStatusType backrefed_mem
#define NQ_TARGET_ISNOT_EMPTY
#define ONIG_SYN_OP2_ESC_G_BRACE_BACKREF
Node * onig_node_new_list(Node *left, Node *right)
#define ONIGENC_CTYPE_LOWER
#define ONIG_SYN_OP2_ESC_K_NAMED_BACKREF
#define ONIGENC_IS_ASCII_CODE(code)
#define ONIGERR_INVALID_CHAR_PROPERTY_NAME
#define NODE_BACKREFS_SIZE
#define ANCHOR_SEMI_END_BUF
#define ONIGERR_EMPTY_GROUP_NAME
#define ONIG_SYN_OP2_OPTION_PERL
Node * onig_node_new_str(const UChar *s, const UChar *end)
#define ONIG_SYN_OP_ESC_O_BRACE_OCTAL
#define ONIGENC_GET_CTYPE_CODE_RANGE(enc, ctype, sbout, ranges)
#define ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END
#define ONIG_SYN_OP_ESC_BRACE_INTERVAL
#define ONIG_SYN_BACKSLASH_ESCAPE_IN_CC
void onig_node_str_clear(Node *node)
Node ** mem_nodes_dynamic
void onig_node_conv_to_str_node(Node *node, int raw)
#define ENCLOSE_STOP_BACKTRACK
#define ONIG_SYN_OP_ESC_OCTAL3
UChar * onigenc_step(OnigEncoding enc, const UChar *p, const UChar *end, int n)
void onig_node_free(Node *node)
register unsigned int len
#define ONIGENC_CODE_RANGE_FROM(range, i)
#define ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR
#define ONIGERR_END_PATTERN_AT_LEFT_BRACE
#define MC_ZERO_OR_ONE_TIME(syn)
#define ONIG_OPTION_MULTILINE
#define ONIGENC_CTYPE_PUNCT
#define CHECK_NULL_RETURN(p)
struct OnigToken::@103::@105 repeat
#define ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID
#define ONIG_SYN_OP2_QMARK_SUBEXP_CALL
#define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY
#define MBCODE_START_POS(enc)
#define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
#define BBUF_ENSURE_SIZE(buf, size)
#define ONIG_SYN_OP_ESC_B_WORD_BOUND
#define ONIGERR_PREMATURE_END_OF_CHAR_CLASS
#define ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP
#define ONIG_SYN_OP_ESC_S_WHITE_SPACE
#define ONIGERR_PARSE_DEPTH_LIMIT_OVER
#define ONIG_SYN_ALLOW_EMPTY_RANGE_IN_CC
#define ONIGERR_TOO_LONG_WIDE_CHAR_VALUE
OnigCaseFoldType case_fold_flag
#define ONIGENC_CTYPE_BLANK
#define ONIGENC_IS_CODE_XDIGIT(enc, code)
#define ANCHOR_PREC_READ_NOT
#define ENCLOSE_CONDITION
void onig_reduce_nested_quantifier(Node *pnode, Node *cnode)
#define ONIG_OPTION_ASCII_RANGE
#define ONIGENC_CTYPE_GRAPH
#define BITSET_CLEAR_BIT(bs, pos)
#define ONIG_MAX_MULTI_BYTE_RANGES_NUM
#define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE
#define ONIGENC_CODE_TO_MBC(enc, code, buf)
#define ONIG_SYN_OP_DOT_ANYCHAR
const OnigSyntaxType * syntax
#define ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL
int onig_name_to_backref_number(regex_t *reg, const UChar *name, const UChar *name_end, const OnigRegion *region)
#define ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP
struct rb_encoding_entry * list
#define IS_POSIX_BRACKET_ALL_RANGE(option)
#define IS_SYNTAX_OP2(syn, opm)
#define ONIGERR_INVALID_REPEAT_RANGE_PATTERN
#define ONIGERR_INVALID_POSIX_BRACKET_TYPE
#define ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC
#define ONOFF(v, f, negative)
#define ONIG_SYN_OP2_ESC_U_HEX4
struct OnigToken::@103::@107 call
#define ONIGENC_CODE_RANGE_TO(range, i)
#define INIT_SCANENV_MEMNODES_ALLOC_SIZE
#define ONIGENC_CTYPE_CNTRL
struct OnigToken::@103::@104 anchor
int onigenc_with_ascii_strncmp(OnigEncoding enc, const UChar *p, const UChar *end, const UChar *sascii, int n)
#define ONIG_SYN_OP2_OPTION_RUBY
int onig_parse_make_tree(Node **root, const UChar *pattern, const UChar *end, regex_t *reg, ScanEnv *env)
#define ONIG_SYN_OP_LPAREN_SUBEXP
int onig_scan_unsigned_number(UChar **src, const UChar *end, OnigEncoding enc)
#define NSTRING_SET_RAW(node)
#define ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP
int onig_noname_group_capture_is_active(const regex_t *reg)
#define ONIG_SYN_OP_ESC_LPAREN_SUBEXP
#define BIT_STATUS_BITS_NUM
#define ANCHOR_LOOK_BEHIND
int(* func)(const UChar *, const UChar *, int, int *, regex_t *, void *)
#define ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY
void onig_strcpy(UChar *dest, const UChar *src, const UChar *end)
#define POSIX_BRACKET_NAME_MIN_LEN
BitStatusType bt_mem_start
#define ONIGENC_IS_CODE_DIGIT(enc, code)
#define IS_MC_ESC_CODE(code, syn)
#define ANCHOR_WORD_BOUND
#define ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR
#define ONIGENC_CTYPE_DIGIT
#define ONIG_SYN_OP2_QMARK_GROUP_EFFECT
int onig_renumber_name_table(regex_t *reg, GroupNumRemap *map)
#define ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE
#define ONIGERR_UNMATCHED_CLOSE_PARENTHESIS
#define ONIG_MAX_BACKREF_NUM
#define ONIGERR_EMPTY_CHAR_CLASS
#define ONIG_SYN_OP_ESC_VBAR_ALT
const OnigSyntaxType * OnigDefaultSyntax
#define ONIG_SYN_OP_LINE_ANCHOR
#define ONIGERR_TOO_SHORT_DIGITS
#define IS_ASCII_RANGE(option)
#define ONIG_NO_SUPPORT_CONFIG
#define SET_NTYPE(node, ntype)
#define ONIGERR_PARSER_BUG
#define ONIGERR_INVALID_CONDITION_PATTERN
#define ONIG_SYN_ALLOW_INVALID_INTERVAL
#define ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET
#define ONIGERR_TOO_MANY_MULTI_BYTE_RANGES
#define ONIGENC_CTYPE_UPPER
#define ONIGENC_IS_CODE_NAME(enc, c)
#define enclen(enc, p, e)
BitStatusType capture_history
#define ONIG_SYN_OP_ESC_X_HEX2
Node * onig_node_new_anchor(int type)