0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4250xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4260xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4270xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4280xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4290xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4300x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
4310x08,0x09,0xff,0xff,0xff,0xff,0xff,0xff,
4320xff,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0xff,
4330xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4340xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4350xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4360xff,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0xff,
4370xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4380xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4390xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4400xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4410xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4420xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4430xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4440xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4450xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4460xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4470xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4480xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4490xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4500xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4510xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4520xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4530xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4540xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4550xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
4630xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4640xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4650xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4660xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4670xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4680xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4690xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4700xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4710xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4720xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4730xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4740xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4750xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4760xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4770xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4780xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4790xff,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0xff,
4800xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4810xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4820xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4830xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4840xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4850xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4860xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4870xff,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0xff,
4880xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4890xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4900xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4910xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4920xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4930x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
4940x08,0x09,0xff,0xff,0xff,0xff,0xff,0xff};
507 #define ESCAPES_FIRST CHAR_0 508 #define ESCAPES_LAST CHAR_z 509 #define UPPER_CASE(c) (c-32) 560 #define ESCAPES_FIRST CHAR_a 561 #define ESCAPES_LAST CHAR_9 562 #define UPPER_CASE(c) (c+64) 564 #define ESCAPES_FIRST ((unsigned char)'\x81') 565 #define ESCAPES_LAST ((unsigned char)'\xf9') 566 #define UPPER_CASE(c) (c-32) 569 static const short int escapes[] = {
571-
ESC_h, 0, 0,
'{', 0, 0, 0, 0,
5730,
CHAR_CR, 0,
'}', 0, 0, 0, 0,
5750, -
ESC_z, 0, 0, 0,
'[', 0, 0,
5760, 0, 0, 0, 0, 0, 0, 0,
5770, 0, 0, 0, 0,
']',
'=',
'-',
579-
ESC_H, 0, 0, 0, 0, 0, 0, 0,
5830, -
ESC_Z, 0, 0, 0, 0, 0, 0,
5840, 0, 0, 0, 0, 0, 0, 0,
591 static unsigned charebcdic_escape_c[] =
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_";
7075, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 6, 0 };
742 #ifdef SUPPORT_UNICODE 747 static intposix_substitutes[] = {
763 #define POSIX_SUBSIZE (sizeof(posix_substitutes) / (2*sizeof(uint32_t))) 769 #define PUBLIC_LITERAL_COMPILE_OPTIONS \ 770 (PCRE2_ANCHORED|PCRE2_AUTO_CALLOUT|PCRE2_CASELESS|PCRE2_ENDANCHORED| \ 771 PCRE2_FIRSTLINE|PCRE2_LITERAL|PCRE2_MATCH_INVALID_UTF| \ 772 PCRE2_NO_START_OPTIMIZE|PCRE2_NO_UTF_CHECK|PCRE2_USE_OFFSET_LIMIT|PCRE2_UTF) 774 #define PUBLIC_COMPILE_OPTIONS \ 775 (PUBLIC_LITERAL_COMPILE_OPTIONS| \ 776 PCRE2_ALLOW_EMPTY_CLASS|PCRE2_ALT_BSUX|PCRE2_ALT_CIRCUMFLEX| \ 777 PCRE2_ALT_VERBNAMES|PCRE2_DOLLAR_ENDONLY|PCRE2_DOTALL|PCRE2_DUPNAMES| \ 778 PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_MATCH_UNSET_BACKREF| \ 779 PCRE2_MULTILINE|PCRE2_NEVER_BACKSLASH_C|PCRE2_NEVER_UCP| \ 780 PCRE2_NEVER_UTF|PCRE2_NO_AUTO_CAPTURE|PCRE2_NO_AUTO_POSSESS| \ 781 PCRE2_NO_DOTSTAR_ANCHOR|PCRE2_UCP|PCRE2_UNGREEDY) 783 #define PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS \ 784 (PCRE2_EXTRA_MATCH_LINE|PCRE2_EXTRA_MATCH_WORD|PCRE2_EXTRA_CASELESS_RESTRICT) 786 #define PUBLIC_COMPILE_EXTRA_OPTIONS \ 787 (PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS| \ 788 PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES|PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL| \ 789 PCRE2_EXTRA_ESCAPED_CR_IS_LF|PCRE2_EXTRA_ALT_BSUX| \ 790 PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK|PCRE2_EXTRA_ASCII_BSD| \ 791 PCRE2_EXTRA_ASCII_BSS|PCRE2_EXTRA_ASCII_BSW|PCRE2_EXTRA_ASCII_POSIX| \ 792 PCRE2_EXTRA_ASCII_DIGIT) 802 ERR1,
ERR2,
ERR3,
ERR4,
ERR5,
ERR6,
ERR7,
ERR8,
ERR9,
ERR10,
803 ERR11,
ERR12,
ERR13,
ERR14,
ERR15,
ERR16,
ERR17,
ERR18,
ERR19,
ERR20,
804 ERR21,
ERR22,
ERR23,
ERR24,
ERR25,
ERR26,
ERR27,
ERR28,
ERR29,
ERR30,
805 ERR31,
ERR32,
ERR33,
ERR34,
ERR35,
ERR36,
ERR37,
ERR38,
ERR39,
ERR40,
806 ERR41,
ERR42,
ERR43,
ERR44,
ERR45,
ERR46,
ERR47,
ERR48,
ERR49,
ERR50,
807 ERR51,
ERR52,
ERR53,
ERR54,
ERR55,
ERR56,
ERR57,
ERR58,
ERR59,
ERR60,
808 ERR61,
ERR62,
ERR63,
ERR64,
ERR65,
ERR66,
ERR67,
ERR68,
ERR69,
ERR70,
809 ERR71,
ERR72,
ERR73,
ERR74,
ERR75,
ERR76,
ERR77,
ERR78,
ERR79,
ERR80,
810 ERR81,
ERR82,
ERR83,
ERR84,
ERR85,
ERR86,
ERR87,
ERR88,
ERR89,
ERR90,
811 ERR91,
ERR92,
ERR93,
ERR94,
ERR95,
ERR96,
ERR97,
ERR98,
ERR99,
ERR100,
8680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8690, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
920 #ifdef DEBUG_SHOW_PARSED 940fprintf(stderr,
"+++ %02d %.8x ", (
int)(pptr - cb->
parsed_pattern), *pptr);
944 if(*pptr > 32 && *pptr < 128) fprintf(stderr,
"%c", *pptr);
951fprintf(stderr,
"**** OOPS - unknown META value - giving up ****\n");
955fprintf(stderr,
"META_END\n");
959fprintf(stderr,
"META_CAPTURE %d", meta_arg);
964fprintf(stderr,
"META_RECURSE %d %zd", meta_arg,
offset);
972fprintf(stderr,
"META_BACKREF %d %zd", meta_arg,
offset);
980fprintf(stderr,
"META \\%c %d %d", (meta_arg ==
ESC_P)?
'P':
'p',
994fprintf(stderr,
"META \\%c", cc);
1002fprintf(stderr,
"META {%d,%d}",
min,
max);
1004fprintf(stderr,
"META {%d,}",
min);
1011fprintf(stderr,
"META {%d,%d}?",
min,
max);
1013fprintf(stderr,
"META {%d,}?",
min);
1020fprintf(stderr,
"META {%d,%d}+",
min,
max);
1022fprintf(stderr,
"META {%d,}+",
min);
1025 case META_BIGVALUE: fprintf(stderr,
"META_BIGVALUE %.8x", *pptr++);
break;
1028 case META_DOLLAR: fprintf(stderr,
"META_DOLLAR");
break;
1029 case META_DOT: fprintf(stderr,
"META_DOT");
break;
1033 case META_PLUS: fprintf(stderr,
"META +");
break;
1036 case META_QUERY: fprintf(stderr,
"META ?");
break;
1040 case META_ATOMIC: fprintf(stderr,
"META (?>");
break;
1046 case META_KET: fprintf(stderr,
"META )");
break;
1047 case META_ALT: fprintf(stderr,
"META | %d", meta_arg);
break;
1049 case META_CLASS: fprintf(stderr,
"META [");
break;
1058 case META_POSIX: fprintf(stderr,
"META_POSIX %d", *pptr++);
break;
1059 case META_POSIX_NEG: fprintf(stderr,
"META_POSIX_NEG %d", *pptr++);
break;
1061 case META_ACCEPT: fprintf(stderr,
"META (*ACCEPT)");
break;
1062 case META_FAIL: fprintf(stderr,
"META (*FAIL)");
break;
1063 case META_COMMIT: fprintf(stderr,
"META (*COMMIT)");
break;
1064 case META_PRUNE: fprintf(stderr,
"META (*PRUNE)");
break;
1065 case META_SKIP: fprintf(stderr,
"META (*SKIP)");
break;
1066 case META_THEN: fprintf(stderr,
"META (*THEN)");
break;
1069fprintf(stderr,
"META_OPTIONS 0x%08x 0x%08x", pptr[0], pptr[1]);
1074fprintf(stderr,
"META (?<= %d %d", meta_arg, *pptr);
1079fprintf(stderr,
"META (*naplb: %d %d", meta_arg, *pptr);
1084fprintf(stderr,
"META (?<! %d %d", meta_arg, *pptr);
1089fprintf(stderr,
"META (?C%d) next=%d/%d", pptr[2], pptr[0],
1098fprintf(stderr,
"META (?Cstring) length=%d offset=", *pptr++);
1100fprintf(stderr,
"%zd next=%d/%d",
offset, patoffset, patlength);
1105fprintf(stderr,
"META (?(&name) length=%d offset=", *pptr++);
1107fprintf(stderr,
"%zd",
offset);
1111fprintf(stderr,
"META_BACKREF_BYNAME length=%d offset=", *pptr++);
1113fprintf(stderr,
"%zd",
offset);
1117fprintf(stderr,
"META_COND_NUMBER %d offset=", pptr[
SIZEOFFSET]);
1119fprintf(stderr,
"%zd",
offset);
1124fprintf(stderr,
"META (?(DEFINE) offset=");
1126fprintf(stderr,
"%zd",
offset);
1130fprintf(stderr,
"META (?(VERSION%s", (*pptr++ == 0)?
"=":
">=");
1131fprintf(stderr,
"%d.", *pptr++);
1132fprintf(stderr,
"%d)", *pptr++);
1136fprintf(stderr,
"META (?(<name>) length=%d offset=", *pptr++);
1138fprintf(stderr,
"%zd",
offset);
1142fprintf(stderr,
"META (?(R&name) length=%d offset=", *pptr++);
1144fprintf(stderr,
"%zd",
offset);
1150fprintf(stderr,
"META (?(Rnumber) length=%d offset=", *pptr++);
1152fprintf(stderr,
"%zd",
offset);
1156fprintf(stderr,
"META (*MARK:");
1160fprintf(stderr,
"META (*COMMIT:");
1164fprintf(stderr,
"META (*PRUNE:");
1168fprintf(stderr,
"META (*SKIP:");
1172fprintf(stderr,
"META (*THEN:");
1175 for(
i= 0;
i< length;
i++)
1178 if(cc > 32 && cc < 128) fprintf(stderr,
"%c", cc);
1179 elsefprintf(stderr,
"\\x{%x}", cc);
1181fprintf(stderr,
") length=%u", length);
1184fprintf(stderr,
"\n");
1206newcode =
code->memctl.malloc(
code->blocksize,
code->memctl.memory_data);
1207 if(newcode ==
NULL)
return NULL;
1208memcpy(newcode,
code,
code->blocksize);
1209newcode->executable_jit =
NULL;
1241newcode =
code->memctl.malloc(
code->blocksize,
code->memctl.memory_data);
1242 if(newcode ==
NULL)
return NULL;
1243memcpy(newcode,
code,
code->blocksize);
1244newcode->executable_jit =
NULL;
1247 code->memctl.memory_data);
1248 if(newtables ==
NULL)
1250 code->memctl.free((
void*)newcode,
code->memctl.memory_data);
1257newcode->tables = newtables;
1276 if(
code->executable_jit !=
NULL)
1290 if(*ref_count == 0)
1291 code->memctl.free((
void*)
code->tables,
code->memctl.memory_data);
1335 if(allow_sign >= 0 && ptr < ptrend)
1340max_value -= allow_sign;
1351 while(ptr < ptrend &&
IS_DIGIT(*ptr))
1356*errorcodeptr = max_error;
1361 if(allow_sign >= 0 && sign != 0)
1365*errorcodeptr =
ERR26;
1369 if(sign > 0)
n+= allow_sign;
1370 else if((
int)
n> allow_sign)
1372*errorcodeptr =
ERR15;
1375 else n= allow_sign + 1 -
n;
1432had_minimum =
TRUE;
1433 while(++pp < ptrend &&
IS_DIGIT(*pp)) {}
1437 if(pp >= ptrend)
return FALSE;
1441 if(!had_minimum)
return FALSE;
1447 if(pp >= ptrend)
return FALSE;
1450 while(++pp < ptrend &&
IS_DIGIT(*pp)) {}
1452 else if(!had_minimum)
return FALSE;
1466 if(*errorcodeptr != 0)
gotoEXIT;
1471 if(*errorcodeptr != 0)
gotoEXIT;
1490 if(*errorcodeptr != 0)
gotoEXIT;
1495*errorcodeptr =
ERR4;
1567*errorcodeptr =
ERR1;
1623*errorcodeptr =
ERR93;
1631 else*errorcodeptr =
ERR93;
1642*errorcodeptr =
ERR37;
1665*errorcodeptr =
ERR3;
1679*errorcodeptr =
ERR37;
1691 if(!alt_bsux) *errorcodeptr =
ERR37;
else 1695 if(ptr >= ptrend)
break;
1702 while(hptr < ptrend && (xc =
XDIGIT(*hptr)) != 0xff)
1704 if((cc & 0xf0000000) != 0)
1706*errorcodeptr =
ERR77;
1710cc = (cc << 4) | xc;
1714 if(hptr == ptr + 1 ||
1729 if(ptrend - ptr < 4)
break;
1730 if((cc =
XDIGIT(ptr[0])) == 0xff)
break;
1731 if((xc =
XDIGIT(ptr[1])) == 0xff)
break;
1732cc = (cc << 4) | xc;
1733 if((xc =
XDIGIT(ptr[2])) == 0xff)
break;
1734cc = (cc << 4) | xc;
1735 if((xc =
XDIGIT(ptr[3])) == 0xff)
break;
1742 if(c > 0x10ffffU) *errorcodeptr =
ERR77;
1744 if(c >= 0xd800 && c <= 0xdfff &&
1746*errorcodeptr =
ERR73;
1748 else if(c > MAX_NON_UTF_CHAR) *errorcodeptr =
ERR77;
1756 if(!alt_bsux) *errorcodeptr =
ERR37;
1781 if(isclass)
break;
1785*errorcodeptr =
ERR57;
1806 if(*errorcodeptr == 0) escape =
ESC_k;
1813*errorcodeptr =
ERR57;
1826 if(*errorcodeptr == 0) *errorcodeptr =
ERR57;
1833*errorcodeptr =
ERR15;
1870 if(
read_number(&ptr, ptrend, -1, INT_MAX/10 - 1, 0, &s, errorcodeptr) &&
1886 if(c >=
CHAR_8)
break;
1898 while(
i++ < 2 && ptr < ptrend && *ptr >=
CHAR_0&& *ptr <=
CHAR_7)
1899c = c * 8 + *ptr++ -
CHAR_0;
1900 #if PCRE2_CODE_UNIT_WIDTH == 8 1901 if(!
utf&& c > 0xff) *errorcodeptr =
ERR51;
1913*errorcodeptr =
ERR55;
1920*errorcodeptr =
ERR78;
1926 while(ptr < ptrend && *ptr >=
CHAR_0&& *ptr <=
CHAR_7)
1929 if(c == 0 && cc ==
CHAR_0)
continue;
1930 #if PCRE2_CODE_UNIT_WIDTH == 32 1931 if(c >= 0x20000000l) { overflow =
TRUE;
break; }
1933c = (c << 3) + (cc -
CHAR_0);
1934 #if PCRE2_CODE_UNIT_WIDTH == 8 1935 if(c > (
utf? 0x10ffffU : 0xffU)) { overflow =
TRUE;
break; }
1936 #elif PCRE2_CODE_UNIT_WIDTH == 16 1937 if(c > (
utf? 0x10ffffU : 0xffffU)) { overflow =
TRUE;
break; }
1938 #elif PCRE2_CODE_UNIT_WIDTH == 32 1939 if(
utf&& c > 0x10ffffU) { overflow =
TRUE;
break; }
1947 while(ptr < ptrend && *ptr >=
CHAR_0&& *ptr <=
CHAR_7) ptr++;
1948*errorcodeptr =
ERR34;
1952 if(
utf&& c >= 0xd800 && c <= 0xdfff &&
1956*errorcodeptr =
ERR73;
1962*errorcodeptr =
ERR64;
1973 if(ptrend - ptr < 2)
break;
1974 if((cc =
XDIGIT(ptr[0])) == 0xff)
break;
1975 if((xc =
XDIGIT(ptr[1])) == 0xff)
break;
1999*errorcodeptr =
ERR78;
2005 while(ptr < ptrend && (cc =
XDIGIT(*ptr)) != 0xff)
2008 if(c == 0 && cc == 0)
continue;
2009 #if PCRE2_CODE_UNIT_WIDTH == 32 2010 if(c >= 0x10000000l) { overflow =
TRUE;
break; }
2013 if((
utf&& c > 0x10ffffU) || (!
utf&& c > MAX_NON_UTF_CHAR))
2028 while(ptr < ptrend &&
XDIGIT(*ptr) != 0xff) ptr++;
2029*errorcodeptr =
ERR34;
2033 if(
utf&& c >= 0xd800 && c <= 0xdfff &&
2037*errorcodeptr =
ERR73;
2049*errorcodeptr =
ERR67;
2058 if(ptr >= ptrend || (cc =
XDIGIT(*ptr)) == 0xff)
break;
2061 if(ptr >= ptrend || (cc =
XDIGIT(*ptr)) == 0xff)
break;
2082 #if defined EBCDIC && 'a' != 0x81 2089*errorcodeptr =
ERR2;
2098 if(c < 32 || c > 126)
2100*errorcodeptr =
ERR68;
2112c = (
'\\'== 188 &&
'`'== 74)? 0x5f : 0xff;
2115 for(
i= 0;
i< 32;
i++)
2117 if(c == ebcdic_escape_c[
i])
break;
2119 if(
i< 32) c =
i;
else*errorcodeptr =
ERR68;
2130*errorcodeptr =
ERR3;
2145 #ifdef SUPPORT_UNICODE 2198 #if PCRE2_CODE_UNIT_WIDTH != 8 2199 while(c ==
'_'|| c ==
'-'|| (c <= 0xff &&
isspace(c)))
2201 while(c ==
'_'|| c ==
'-'||
isspace(c))
2207 if(c ==
CHAR_NUL)
gotoERROR_RETURN;
2210 if((c ==
':'|| c ==
'=') && vptr ==
NULL) vptr = name +
i;
2225 else gotoERROR_RETURN;
2269*errorcodeptr =
ERR47;
2282top =
PRIV(utt_size);
2287 i= (bot + top) >> 1;
2288 r=
PRIV(strcmp_c8)(name,
PRIV(utt_names) +
PRIV(utt)[
i].name_offset);
2295*pdataptr =
PRIV(utt)[
i].value;
2298*ptypeptr =
PRIV(utt)[
i].type;
2309*ptypeptr = ptscript;
2316 if(
r> 0) bot =
i+ 1;
elsetop =
i;
2319*errorcodeptr =
ERR47;
2323*errorcodeptr =
ERR46;
2382 for(; ptrend - ptr >= 2; ptr++)
2425 PRIV(strncmp_c8)(ptr, pn, (
unsigned int)
len) == 0)
returnyield;
2477*errorcodeptr = is_group?
ERR62:
2488 #ifdef SUPPORT_UNICODE 2489 if(
utf&& is_group)
2498*errorcodeptr =
ERR44;
2507FORWARDCHARTEST(ptr, ptrend);
2508 if(ptr >= ptrend)
break;
2525*errorcodeptr =
ERR44;
2539*errorcodeptr =
ERR48;
2542*namelenptr = (
uint32_t)(ptr - *nameptr);
2549 if(ptr == *nameptr)
2551*errorcodeptr =
ERR62;
2558*errorcodeptr =
ERR42;
2598 uint32_t*previous_callout = *pcalloutptr;
2600 if(previous_callout !=
NULL) previous_callout[2] = (
uint32_t)(ptr -
2603 if(!auto_callout) previous_callout =
NULL;
else 2605 if(previous_callout ==
NULL||
2606previous_callout != parsed_pattern - 4 ||
2607previous_callout[3] != 255)
2609previous_callout = parsed_pattern;
2610parsed_pattern += 4;
2612previous_callout[2] = 0;
2613previous_callout[3] = 255;
2618*pcalloutptr = previous_callout;
2619 returnparsed_pattern;
2672 if((options &
PCRE2_UCP) == 0 || (xoptions & ascii_option) != 0)
2688*parsed_pattern++ =
PT_SPACE<< 16;
2693*parsed_pattern++ =
PT_WORD<< 16;
2698 returnparsed_pattern;
2734 #define NSF_RESET 0x0001u 2735 #define NSF_CONDASSERT 0x0002u 2736 #define NSF_ATOMICSR 0x0004u 2743 #define PARSE_TRACKED_OPTIONS (PCRE2_CASELESS|PCRE2_DOTALL|PCRE2_DUPNAMES| \ 2744 PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_MULTILINE|PCRE2_NO_AUTO_CAPTURE| \ 2747 #define PARSE_TRACKED_EXTRA_OPTIONS (PCRE2_EXTRA_CASELESS_RESTRICT| \ 2748 PCRE2_EXTRA_ASCII_BSD|PCRE2_EXTRA_ASCII_BSS|PCRE2_EXTRA_ASCII_BSW| \ 2749 PCRE2_EXTRA_ASCII_DIGIT|PCRE2_EXTRA_ASCII_POSIX) 2760 #if PCRE2_CODE_UNIT_WIDTH == 32 2761 #define PARSED_LITERAL(c, p) \ 2763 if (c >= META_END) *p++ = META_BIGVALUE; \ 2765 okquantifier = TRUE; \ 2768 #define PARSED_LITERAL(c, p) *p++ = c; okquantifier = TRUE; 2791 intafter_manual_callout = 0;
2792 intexpect_cond_assert = 0;
2829 while(ptr < ptrend)
2831 if(parsed_pattern >= parsed_pattern_end)
2840auto_callout, parsed_pattern, cb);
2855end_nests = (
nest_save*)((
char*)end_nests -
2864 while(ptr < ptrend)
2866 intprev_expect_cond_assert;
2867 uint32_tmin_repeat = 0, max_repeat = 0;
2872 BOOLprev_okquantifier;
2876 if(parsed_pattern >= parsed_pattern_end)
2893 if(this_parsed_item != parsed_pattern)
2895prev_parsed_item = this_parsed_item;
2896this_parsed_item = parsed_pattern;
2916 if(expect_cond_assert > 0)
2924 #if PCRE2_CODE_UNIT_WIDTH == 32 2927*parsed_pattern++ = c;
2931 if(after_manual_callout-- <= 0)
2933auto_callout, parsed_pattern, cb);
2936meta_quantifier = 0;
2958(c > 255 && (c|1) != 0x200f && (c|1) != 0x2029) ||
2973 #if PCRE2_CODE_UNIT_WIDTH == 32 2976*parsed_pattern++ = c;
2980inverbname =
FALSE;
2982verbnamelength = (
PCRE2_SIZE)(parsed_pattern - verblengthptr - 1);
2984 if(ptr - verbnamestart - 1 > (
int)
MAX_MARK)
2990*verblengthptr = (
uint32_t)verbnamelength;
2996 if(add_after_mark != 0)
2998*parsed_pattern++ = add_after_mark;
3006escape =
PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options,
3007xoptions,
FALSE, cb);
3008 if(errorcode != 0)
goto FAILED;
3015 #if PCRE2_CODE_UNIT_WIDTH == 32 3018*parsed_pattern++ = c;
3022*parsed_pattern++ =
CHAR_u;
3050inescq = *ptr ==
CHAR_Q;
3067 #ifdef SUPPORT_UNICODE 3068 if(c ==
CHAR_NEL|| (c|1) == 0x200f || (c|1) == 0x2029)
continue;
3072 while(ptr < ptrend)
3080 #ifdef SUPPORT_UNICODE 3081 if(
utf) FORWARDCHARTEST(ptr, ptrend);
3111 if(after_manual_callout-- <= 0)
3113parsed_pattern =
manage_callouts(thisptr, &previous_callout, auto_callout,
3114parsed_pattern, cb);
3115this_parsed_item = parsed_pattern;
3128 if(expect_cond_assert > 0)
3138 else switch(ptr[1])
3141 ok= expect_cond_assert == 2;
3168prev_expect_cond_assert = expect_cond_assert;
3169expect_cond_assert = 0;
3174prev_okquantifier = okquantifier;
3175prev_meta_quantifier = meta_quantifier;
3176okquantifier =
FALSE;
3177meta_quantifier = 0;
3187parsed_pattern[(prev_meta_quantifier ==
META_MINMAX)? -3 : -1] =
31890x00020000u : 0x00010000u);
3206escape =
PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options,
3207xoptions,
FALSE, cb);
3235 else if(escape < 0)
3249okquantifier =
TRUE;
3268 else switch(escape)
3271 #ifdef NEVER_BACKSLASH_C 3281okquantifier =
TRUE;
3291*parsed_pattern++ =
CHAR_u;
3296 #ifndef SUPPORT_UNICODE 3306okquantifier =
TRUE;
3322okquantifier =
TRUE;
3323parsed_pattern =
handle_escdsw(escape, parsed_pattern, options,
3331 #ifdef SUPPORT_UNICODE 3335 if(!get_ucp(&ptr, &negated, &ptype, &pdata, &errorcode, cb))
3339*parsed_pattern++ = (ptype << 16) | pdata;
3340okquantifier =
TRUE;
3383 if(errorcode != 0)
gotoESCAPE_FAILED;
3390&errorcode, cb))
gotoESCAPE_FAILED;
3398*parsed_pattern++ = namelen;
3401okquantifier =
TRUE;
3419okquantifier =
TRUE;
3427 gotoCHECK_QUANTIFIER;
3431 gotoCHECK_QUANTIFIER;
3435 gotoCHECK_QUANTIFIER;
3444 if(errorcode != 0)
goto FAILED;
3458 if(!prev_okquantifier)
3473 for(p = parsed_pattern - 1; p >= verbstartptr; p--) p[1] = p[0];
3476parsed_pattern += 2;
3484*parsed_pattern++ = meta_quantifier;
3487*parsed_pattern++ = min_repeat;
3488*parsed_pattern++ = max_repeat;
3496okquantifier =
TRUE;
3504 if(ptrend - ptr >= 6 &&
3517*has_lookbehind =
TRUE;
3530*parsed_pattern++ =
PT_WORD<< 16;
3553negate_class =
FALSE;
3554 while(ptr < ptrend)
3559 if(ptr < ptrend && *ptr ==
CHAR_E) ptr++;
3560 else if(ptrend - ptr >= 3 &&
3570negate_class =
TRUE;
3611 gotoCLASS_CONTINUE;
3620 gotoCLASS_CONTINUE;
3629ptrend - ptr >= 3 &&
3656posix_negate =
TRUE;
3661 if(posix_class < 0)
3674 if(ptr < ptrend - 1 && *ptr ==
CHAR_MINUS&&
3698 #ifdef SUPPORT_UNICODE 3704 intptype = posix_substitutes[2*posix_class];
3705 intpvalue = posix_substitutes[2*posix_class + 1];
3710*parsed_pattern++ = (ptype << 16) | pvalue;
3711 gotoCLASS_CONTINUE;
3717 gotoCLASS_CONTINUE;
3727*parsed_pattern++ = posix_class;
3746 if(c == parsed_pattern[-2])
3748 else if(parsed_pattern[-2] > c)
3763class_range_state = char_is_literal?
3774escape =
PRIV(check_escape)(&ptr, ptrend, &c, &errorcode, options,
3775xoptions,
TRUE, cb);
3792char_is_literal =
FALSE;
3797char_is_literal =
FALSE;
3802 gotoCLASS_CONTINUE;
3805 gotoCLASS_CONTINUE;
3853parsed_pattern =
handle_escdsw(escape, parsed_pattern, options,
3861 #ifdef SUPPORT_UNICODE 3865 if(!get_ucp(&ptr, &negated, &ptype, &pdata, &errorcode, cb))
3869*parsed_pattern++ = (ptype << 16) | pdata;
3886 if(ptr < ptrend - 1 && *ptr ==
CHAR_MINUS&&
3921 if(ptr >= ptrend)
gotoUNCLOSED_PARENTHESIS;
3967&errorcode, cb))
goto FAILED;
3979 PRIV(strncmp_c8)(name, vn, namelen) == 0)
3994 if(prev_expect_cond_assert > 0 &&
4015 gotoPOSITIVE_LOOK_AHEAD;
4018 gotoPOSITIVE_NONATOMIC_LOOK_AHEAD;
4021 gotoNEGATIVE_LOOK_AHEAD;
4026*parsed_pattern++ = meta;
4028 gotoPOST_LOOKBEHIND;
4037 #ifdef SUPPORT_UNICODE 4045 else if(++top_nest >= end_nests)
4070&errorcode, cb))
goto FAILED;
4083 PRIV(strncmp_c8)(name, vn, namelen) == 0)
4096 if(*ptr ==
CHAR_COLON&& ptr + 1 < ptrend &&
4111verbstartptr = parsed_pattern;
4127 if(
verbs[
i].has_arg < 0)
4144verblengthptr = parsed_pattern++;
4145verbnamestart = ptr;
4165 if(++ptr >= ptrend)
gotoUNCLOSED_PARENTHESIS;
4171 gotoRECURSION_BYNUMBER;
4178 else if(++top_nest >= end_nests)
4184top_nest->
flags= 0;
4301 if(ptr < ptrend && *ptr ==
CHAR_x)
4323options = (options |
set) & (~unset);
4324xoptions = (xoptions | xset) & (~xunset);
4333 if(ptr >= ptrend)
gotoUNCLOSED_PARENTHESIS;
4338(top_nest-1)->
nest_depth== nest_depth) top_nest--;
4345 if(options != oldoptions || xoptions != oldxoptions)
4348*parsed_pattern++ = options;
4349*parsed_pattern++ = xoptions;
4358 if(++ptr >= ptrend)
gotoUNCLOSED_PARENTHESIS;
4382&namelen, &errorcode, cb))
goto FAILED;
4384*parsed_pattern++ = namelen;
4386okquantifier =
TRUE;
4406 if(ptrend - ptr < 2 || !
IS_DIGIT(ptr[1]))
4419&
i, &errorcode))
goto FAILED;
4426 gotoUNCLOSED_PARENTHESIS;
4433okquantifier =
TRUE;
4442&namelen, &errorcode, cb))
goto FAILED;
4444*parsed_pattern++ = namelen;
4446okquantifier =
TRUE;
4452 if(++ptr >= ptrend)
gotoUNCLOSED_PARENTHESIS;
4463expect_cond_assert = prev_expect_cond_assert - 1;
4471previous_callout == parsed_pattern - 4 &&
4472parsed_pattern[-1] == 255)
4473parsed_pattern = previous_callout;
4478previous_callout = parsed_pattern;
4479after_manual_callout = 1;
4489 for(
i= 0;
PRIV(callout_start_delims)[
i] != 0;
i++)
4491 if(*ptr ==
PRIV(callout_start_delims)[
i])
4504parsed_pattern += 3;
4508 if(++ptr >= ptrend)
4518calloutlength = (
PCRE2_SIZE)(ptr - startptr);
4524*parsed_pattern++ = (
uint32_t)calloutlength;
4536parsed_pattern += 3;
4537 while(ptr < ptrend &&
IS_DIGIT(*ptr))
4546*parsed_pattern++ =
n;
4562previous_callout[2] = 0;
4586 if(++ptr >= ptrend)
gotoUNCLOSED_PARENTHESIS;
4601expect_cond_assert = 2;
4618*parsed_pattern++ =
i;
4620 else if(errorcode != 0)
goto FAILED;
4624 else if(ptrend - ptr >= 10 &&
4643 gotoBAD_VERSION_CONDITION;
4648 if(ptr >= ptrend)
gotoBAD_VERSION_CONDITION;
4651 if(++ptr >= ptrend || !
IS_DIGIT(*ptr))
gotoBAD_VERSION_CONDITION;
4652minor = (*ptr++ -
CHAR_0) * 10;
4653 if(ptr >= ptrend)
gotoBAD_VERSION_CONDITION;
4656 gotoBAD_VERSION_CONDITION;
4660*parsed_pattern++ =
ge;
4661*parsed_pattern++ = major;
4662*parsed_pattern++ = minor;
4678was_r_ampersand =
TRUE;
4691&errorcode, cb))
goto FAILED;
4695 if(was_r_ampersand)
4711 for(
i= 1;
i< (
int)namelen;
i++)
4713*parsed_pattern = (*name ==
CHAR_R&&
i>= (
int)namelen)?
4754POSITIVE_LOOK_AHEAD:
4757 gotoPOST_ASSERTION;
4760POSITIVE_NONATOMIC_LOOK_AHEAD:
4763 gotoPOST_ASSERTION;
4766NEGATIVE_LOOK_AHEAD:
4769 gotoPOST_ASSERTION;
4778 if(ptrend - ptr <= 1 ||
4791*has_lookbehind =
TRUE;
4808 if(prev_expect_cond_assert > 0)
4811 else if(++top_nest >= end_nests)
4835&errorcode, cb))
goto FAILED;
4873 if(namelen == ng->
length&&
4892 if(i < cb->names_found)
break;
4902 if(newspace ==
NULL)
4949okquantifier =
TRUE;
4958okquantifier =
FALSE;
4968 if(nest_depth == 0)
4981 if(inverbname && ptr >= ptrend)
4990parsed_pattern =
manage_callouts(ptr, &previous_callout, auto_callout,
4991parsed_pattern, cb);
5010 if(parsed_pattern >= parsed_pattern_end)
5017 if(nest_depth == 0)
return0;
5019UNCLOSED_PARENTHESIS:
5036BAD_VERSION_CONDITION:
5065 switch((
int)*
code)
5071 if(!skipassert)
return code;
5080 if(!skipassert)
return code;
5126 #ifdef SUPPORT_UNICODE 5162 for(c = *cptr; c <= d; c++)
5164 #if PCRE2_CODE_UNIT_WIDTH == 32 5168(!restricted ||
PRIV(ucd_caseless_sets)[co] > 127))
5183 if(c > d)
return-1;
5190 next= othercase + 1;
5192 for(++c; c <= d; c++)
5236 uint32_tclassbits_end = (end <= 0xff ? end : 0xff);
5237 unsigned intn8 = 0;
5246 #ifdef SUPPORT_UNICODE 5255 while((rc = get_othercase_range(&c, end, &oc, &od,
5260 if(rc > 0) n8 += add_list_to_class_internal(classbits, uchardptr,
5261options, xoptions, cb,
PRIV(ucd_caseless_sets) + rc, oc);
5273 else if(oc < start && od >= start - 1) start = oc;
5274 else if(od > end && oc <= end + 1)
5277 if(end > classbits_end) classbits_end = (end <= 0xff ? end : 0xff);
5290 for(c = start; c <= classbits_end; c++)
5301 if((options &
PCRE2_UTF) == 0 && end > MAX_NON_UTF_CHAR)
5302end = MAX_NON_UTF_CHAR;
5308 for(c = start; c <= classbits_end; c++)
5315 #ifdef SUPPORT_WIDE_CHARS 5316 if(start <= 0xff) start = 0xff + 1;
5322 #ifdef SUPPORT_UNICODE 5328uchardata +=
PRIV(ord2utf)(start, uchardata);
5329uchardata +=
PRIV(ord2utf)(end, uchardata);
5331 else if(start == end)
5334uchardata +=
PRIV(ord2utf)(start, uchardata);
5343 #if PCRE2_CODE_UNIT_WIDTH == 8 5349*uchardata++ = start;
5352 else if(start == end)
5355*uchardata++ = start;
5358*uchardptr = uchardata;
5369 #ifdef SUPPORT_UNICODE 5396 unsigned intexcept)
5398 unsigned intn8 = 0;
5404 while(p[
n+1] == p[0] +
n+ 1)
n++;
5476 unsigned intn8 = 0;
5482 while(p[
n+1] == p[0] +
n+ 1)
n++;
5519 unsigned intn8 = 0;
5521n8 +=
add_to_class(classbits, uchardptr, options, xoptions, cb, 0, p[0] - 1);
5524 while(p[1] == p[0] + 1) p++;
5525n8 +=
add_to_class(classbits, uchardptr, options, xoptions, cb, p[0] + 1,
5526(p[1] ==
NOTACHAR) ? (
utf? 0x10ffffu : 0xffffffffu) : p[1] - 1);
5575*errorcodeptr =
ERR53;
5589groupnumber =
GET2(slot,0);
5590cb->
backref_map|= (groupnumber < 32)? (1u << groupnumber) : 1;
5595(slot+
IMM2_SIZE)[length] != 0)
break;
5644 intgroup_return = 0;
5645 uint32_trepeat_min = 0, repeat_max = 0;
5646 uint32_tgreedy_default, greedy_non_default;
5656 uint32_tzeroreqcuflags, zerofirstcuflags;
5657 uint32_treq_caseopt, reqvary, tempreqvary;
5678 #ifdef SUPPORT_UNICODE 5691 #ifdef SUPPORT_WIDE_CHARS 5699greedy_non_default = greedy_default ^ 1;
5710firstcu = reqcu = zerofirstcu = zeroreqcu = 0;
5711firstcuflags = reqcuflags = zerofirstcuflags = zeroreqcuflags =
REQ_UNSET;
5725 #ifdef SUPPORT_WIDE_CHARS 5726 BOOLxclass_has_prop;
5729 BOOLshould_flip_negation;
5730 BOOLmatch_all_or_no_wide_chars;
5731 BOOLpossessive_quantifier;
5732 BOOLnote_group_empty;
5733 intclass_has_8bitchar;
5739 uint32_tsubreqcuflags, subfirstcuflags;
5751 if(lengthptr !=
NULL)
5767 if(
code< last_code)
code= last_code;
5777*errorcodeptr =
ERR20;
5781 if(*lengthptr > MAX_PATTERN_SIZE)
5783*errorcodeptr =
ERR20;
5803 if(matched_char && !had_accept) okreturn = 1;
5806previous_matched_char = matched_char;
5807matched_char =
FALSE;
5808note_group_empty =
FALSE;
5819*firstcuptr = firstcu;
5820*firstcuflagsptr = firstcuflags;
5822*reqcuflagsptr = reqcuflags;
5836zerofirstcuflags = firstcuflags =
REQ_NONE;
5850matched_char =
TRUE;
5852zerofirstcu = firstcu;
5853zerofirstcuflags = firstcuflags;
5855zeroreqcuflags = reqcuflags;
5868matched_char =
TRUE;
5871zerofirstcu = firstcu;
5872zerofirstcuflags = firstcuflags;
5891matched_char =
TRUE;
5905 #ifdef SUPPORT_UNICODE 5914 gotoNORMAL_CHAR_SET;
5920zeroreqcuflags = reqcuflags;
5922zerofirstcu = firstcu;
5923zerofirstcuflags = firstcuflags;
5930 #ifdef SUPPORT_UNICODE 5934 PRIV(ucd_caseless_sets)[d] > 127))
5961 #ifdef SUPPORT_UNICODE 5964c < 128 && pptr[2] < 128))
5969 #ifdef SUPPORT_UNICODE 5973 #if PCRE2_CODE_UNIT_WIDTH != 8 5974 if(c > 255) d = c;
else 5979 if(c != d && pptr[2] == d)
5985reset_caseful =
TRUE;
5989 gotoCLASS_CASELESS_CHAR;
6000should_flip_negation = match_all_or_no_wide_chars =
FALSE;
6005 #ifdef SUPPORT_WIDE_CHARS 6008class_uchardata_base = class_uchardata;
6016class_has_8bitchar = 0;
6017 #ifdef SUPPORT_WIDE_CHARS 6018xclass_has_prop =
FALSE;
6026memset(classbits, 0, 32 *
sizeof(
uint8_t));
6037 intposix_class = *(++pptr);
6038 inttaboffset, tabopt;
6041should_flip_negation = local_negate;
6055 #ifdef SUPPORT_UNICODE 6059 switch(posix_class)
6068*class_uchardata++ = 0;
6069xclass_has_prop =
TRUE;
6070 gotoCONTINUE_CLASS;
6089 #if PCRE2_CODE_UNIT_WIDTH == 8 6092match_all_or_no_wide_chars |= local_negate;
6119 for(
int i= 0;
i< 32;
i++) pbits[
i] |= cbits[(
int)
i+ taboffset];
6121 for(
int i= 0;
i< 32;
i++) pbits[
i] &= ~cbits[(
int)
i+ taboffset];
6127 if(tabopt < 0) tabopt = -tabopt;
6128 if(tabopt == 1) pbits[1] &= ~0x3c;
6129 else if(tabopt == 2) pbits[11] &= 0x7f;
6135 for(
int i= 0;
i< 32;
i++) classbits[
i] |= (
uint8_t)(~pbits[
i]);
6137 for(
int i= 0;
i< 32;
i++) classbits[
i] |= pbits[
i];
6141class_has_8bitchar = 1;
6142 gotoCONTINUE_CLASS;
6160 #ifdef DEBUG_SHOW_PARSED 6161fprintf(stderr,
"** Unrecognized parsed pattern item 0x%.8x " 6162 "in character class\n", meta);
6164*errorcodeptr =
ERR89;
6171class_has_8bitchar++;
6176 for(
int i= 0;
i< 32;
i++) classbits[
i] |= cbits[
i+
cbit_digit];
6180should_flip_negation =
TRUE;
6181 for(
int i= 0;
i< 32;
i++)
6186 for(
int i= 0;
i< 32;
i++) classbits[
i] |= cbits[
i+
cbit_word];
6190should_flip_negation =
TRUE;
6191 for(
int i= 0;
i< 32;
i++)
6203 for(
int i= 0;
i< 32;
i++) classbits[
i] |= cbits[
i+
cbit_space];
6207should_flip_negation =
TRUE;
6208 for(
int i= 0;
i< 32;
i++)
6243 #ifdef SUPPORT_UNICODE 6250*class_uchardata++ = ptype;
6251*class_uchardata++ = pdata;
6252xclass_has_prop =
TRUE;
6253class_has_8bitchar--;
6259 gotoCONTINUE_CLASS;
6299 if(range_is_literal &&
6310class_has_8bitchar +=
6311 add_to_class(classbits, &class_uchardata, options, xoptions,
6318class_has_8bitchar +=
6319 add_to_class(classbits, &class_uchardata, options, xoptions,
6326class_has_8bitchar +=
6327 add_to_class(classbits, &class_uchardata, options, xoptions,
6328cb,
C+ uc,
D+ uc);
6335class_has_8bitchar +=
add_to_class(classbits, &class_uchardata,
6336options, xoptions, cb, c, d);
6337 gotoCONTINUE_CLASS;
6343class_has_8bitchar +=
6344 add_to_class(classbits, &class_uchardata, options, xoptions, cb,
6352 #ifdef SUPPORT_WIDE_CHARS 6359 if(class_uchardata > class_uchardata_base)
6362 if(lengthptr !=
NULL)
6364*lengthptr += class_uchardata - class_uchardata_base;
6365class_uchardata = class_uchardata_base;
6378zerofirstcu = firstcu;
6379zerofirstcuflags = firstcuflags;
6381zeroreqcuflags = reqcuflags;
6406 #ifdef SUPPORT_WIDE_CHARS 6411xclass_has_prop || !should_flip_negation))
6413 if(match_all_or_no_wide_chars || (
6417should_flip_negation && !negate_class && (options &
PCRE2_UCP) == 0))
6422class_uchardata +=
PRIV(ord2utf)(0x100, class_uchardata);
6427 #if PCRE2_CODE_UNIT_WIDTH == 16 6428*class_uchardata++ = 0x100;
6429*class_uchardata++ = 0xffffu;
6430 #elif PCRE2_CODE_UNIT_WIDTH == 32 6431*class_uchardata++ = 0x100;
6432*class_uchardata++ = 0xffffffffu;
6436*class_uchardata++ =
XCL_END;
6445 if(class_has_8bitchar > 0)
6450 if(negate_class && !xclass_has_prop)
6453 for(
int i= 0;
i< 32;
i++) classbits[
i] = 255 ^ classbits[
i];
6455memcpy(
code, classbits, 32);
6458 else code= class_uchardata;
6462PUT(previous, 1, (
int)(
code- previous));
6474 if(lengthptr ==
NULL)
6479 for(
int i= 0;
i< 32;
i++) classbits[
i] = 255 ^ classbits[
i];
6481memcpy(
code, classbits, 32);
6498 for(oc = open_caps;
6502 if(lengthptr !=
NULL)
6550verbarglen = *(++pptr);
6553 for(
int i= 0;
i< (
int)verbarglen;
i++)
6556 #ifdef SUPPORT_UNICODE 6557 if(
utf) mclength =
PRIV(ord2utf)(meta, mcbuffer);
else 6563 if(lengthptr !=
NULL) *lengthptr += mclength;
else 6567verbculen += mclength;
6571*tempcode = verbculen;
6582*optionsptr = options = *(++pptr);
6583*xoptionsptr = xoptions = *(++pptr);
6585greedy_non_default = greedy_default ^ 1;
6619 if(length == ng->
length&&
6628 gotoGROUP_PROCESS_NOTE_EMPTY;
6643 for(
i= 1;
i< length;
i++)
6645groupnumber = groupnumber * 10 + name[
i] -
CHAR_0;
6648*errorcodeptr =
ERR61;
6657*errorcodeptr =
ERR15;
6666 if(groupnumber == 0) groupnumber =
RREF_ANY;
6670 gotoGROUP_PROCESS_NOTE_EMPTY;
6684&
count, errorcodeptr, cb))
return0;
6694 gotoGROUP_PROCESS_NOTE_EMPTY;
6712groupnumber = *(++pptr);
6715*errorcodeptr =
ERR15;
6724 gotoGROUP_PROCESS_NOTE_EMPTY;
6739 gotoGROUP_PROCESS_NOTE_EMPTY;
6745 gotoGROUP_PROCESS_NOTE_EMPTY;
6800 gotoGROUP_PROCESS_NOTE_EMPTY;
6804 gotoGROUP_PROCESS_NOTE_EMPTY;
6816GROUP_PROCESS_NOTE_EMPTY:
6817note_group_empty =
TRUE;
6825length_prevgroup = 0;
6853 if(note_group_empty && bravalue !=
OP_COND&& group_return > 0)
6854matched_char =
TRUE;
6890*errorcodeptr =
ERR54;
6907*errorcodeptr =
ERR27;
6910 if(condcount == 1) subfirstcuflags = subreqcuflags =
REQ_NONE;
6911 else if(group_return > 0) matched_char =
TRUE;
6920 if(lengthptr !=
NULL)
6924*errorcodeptr =
ERR20;
6927*lengthptr += length_prevgroup - 2 - 2*
LINK_SIZE;
6952zeroreqcuflags = reqcuflags;
6953zerofirstcu = firstcu;
6954zerofirstcuflags = firstcuflags;
6955groupsetfirstcu =
FALSE;
6969firstcu = subfirstcu;
6970firstcuflags = subfirstcuflags;
6971groupsetfirstcu =
TRUE;
6981 else if(subfirstcuflags < REQ_NONE && subreqcuflags >=
REQ_NONE)
6983subreqcu = subfirstcu;
6984subreqcuflags = subfirstcuflags | tempreqvary;
6993reqcuflags = subreqcuflags;
7012reqcuflags = subreqcuflags;
7041 if(length == ng->
length&&
7044is_dupname = ng->
isdup;
7045groupnumber = ng->
number;
7053meta_arg = groupnumber;
7054 gotoHANDLE_NUMERICAL_RECURSION;
7060cb->
backref_map|= (groupnumber < 32)? (1u << groupnumber) : 1;
7068 if(groupnumber == 0)
7070*errorcodeptr =
ERR15;
7080meta_arg = groupnumber;
7081 gotoHANDLE_SINGLE_REFERENCE;
7091&
count, errorcodeptr, cb))
return0;
7106PUT(
code, 1, pptr[1]);
7122 if(lengthptr !=
NULL)
7124*lengthptr += pptr[3] + (1 + 4*
LINK_SIZE);
7141PUT(
code, 1, pptr[1]);
7158 while(--length > 1)
7166 else*callout_string++ = *pp++;
7173 code= callout_string;
7185repeat_min = *(++pptr);
7186repeat_max = *(++pptr);
7210 if(previous_matched_char && repeat_min > 0) matched_char =
TRUE;
7215reqvary = (repeat_min == repeat_max)? 0 :
REQ_VARY;
7220 if(repeat_min == 0)
7222firstcu = zerofirstcu;
7223firstcuflags = zerofirstcuflags;
7225reqcuflags = zeroreqcuflags;
7237possessive_quantifier =
TRUE;
7244repeat_type = greedy_non_default;
7245possessive_quantifier =
FALSE;
7249repeat_type = greedy_default;
7250possessive_quantifier =
FALSE;
7257tempcode = previous;
7258op_previous = *previous;
7265 switch(op_previous)
7277 if(repeat_max == 1 && repeat_min == 1)
gotoEND_REPEAT;
7282 #ifdef MAYBE_UTF_MULTI 7283 if(
utf&& NOT_FIRSTCU(
code[-1]))
7288memcpy(mcbuffer, lastchar,
CU2BYTES(mclength));
7300mcbuffer[0] =
code[-1];
7302 if(op_previous <= OP_CHARI && repeat_min > 1)
7304reqcu = mcbuffer[0];
7309 gotoOUTPUT_SINGLE_REPEAT;
7314 #ifdef SUPPORT_WIDE_CHARS 7324 if(repeat_max == 0)
7329 if(repeat_max == 1 && repeat_min == 1)
gotoEND_REPEAT;
7335 else if(repeat_min == 0 && repeat_max == 1)
7364 if(repeat_max == 1 && repeat_min == 1 && !possessive_quantifier)
7374 if(repeat_min > 0 && (repeat_min != 1 || repeat_max !=
REPEAT_UNLIMITED))
7376 intreplicate = repeat_min;
7377 if(repeat_min == repeat_max) replicate--;
7383 if(lengthptr !=
NULL)
7389*errorcodeptr =
ERR20;
7392*lengthptr +=
delta;
7395 else for(
int i= 0;
i< replicate;
i++)
7405 if(repeat_min == repeat_max)
break;
7413op_previous = *previous =
OP_BRA;
7447 if(repeat_max == 1 && repeat_min == 1 && !possessive_quantifier)
7455previous[GET(previous, 1)] !=
OP_ALT)
7479 if(repeat_min == 0)
7503 if(repeat_max == 0)
7508brazeroptr = previous;
7530linkoffset = (bralink ==
NULL)? 0 : (
int)(previous - bralink);
7532 PUTINC(previous, 0, linkoffset);
7550 if(lengthptr !=
NULL)
7553 if(
PRIV(ckd_smul)(&
delta, repeat_min - 1,
7554(
int)length_prevgroup) ||
7557*errorcodeptr =
ERR20;
7560*lengthptr +=
delta;
7569 if(groupsetfirstcu && reqcuflags >=
REQ_NONE)
7572reqcuflags = firstcuflags;
7600 if(lengthptr !=
NULL&& repeat_max > 0)
7603 if(
PRIV(ckd_smul)(&
delta, repeat_max,
7604(
int)length_prevgroup + 1 + 2 + 2*
LINK_SIZE) ||
7607*errorcodeptr =
ERR20;
7611*lengthptr +=
delta;
7627linkoffset = (bralink ==
NULL)? 0 : (
int)(
code- bralink);
7639 while(bralink !=
NULL)
7642 intlinkoffset = (
int)(
code- bralink + 1);
7644oldlinkoffset = GET(bra, 1);
7645bralink = (oldlinkoffset == 0)?
NULL: bralink - oldlinkoffset;
7648PUT(bra, 1, linkoffset);
7685 if(*bracode ==
OP_ONCE&& possessive_quantifier) *bracode =
OP_BRA;
7703 if(lengthptr ==
NULL)
7706 if(*bracode ==
OP_COND&& bracode[GET(bracode,1)] !=
OP_ALT)
7712 if(possessive_quantifier)
7720 intnlen = (
int)(
code- bracode);
7727PUT(bracode, 1, nlen);
7742 if(repeat_min < 2) possessive_quantifier =
FALSE;
7763*errorcodeptr =
ERR10;
7768 intprop_type, prop_value;
7771 if(repeat_max == 1 && repeat_min == 1)
gotoEND_REPEAT;
7778prop_type = previous[1];
7779prop_value = previous[2];
7784OUTPUT_SINGLE_REPEAT:
7785prop_type = prop_value = -1;
7800 if(repeat_max == 0)
gotoEND_REPEAT;
7804repeat_type += op_type;
7809 if(repeat_min == 0)
7812 else if(repeat_max == 1) *
code++ =
OP_QUERY+ repeat_type;
7825 else if(repeat_min == 1)
7832 if(repeat_max == 1)
gotoEND_REPEAT;
7851 if(repeat_max != repeat_min)
7860*
code++ = op_previous;
7863*
code++ = prop_type;
7864*
code++ = prop_value;
7874repeat_max -= repeat_min;
7875 if(repeat_max == 1)
7897*
code++ = op_previous;
7900*
code++ = prop_type;
7901*
code++ = prop_value;
7921 if(possessive_quantifier)
7950 #ifdef SUPPORT_UNICODE 7951 if(
utf&& HAS_EXTRALEN(tempcode[-1]))
7952tempcode += GET_EXTRALEN(tempcode[-1]);
7964 #ifdef SUPPORT_WIDE_CHARS 7966tempcode += GET(tempcode, 1);
7980 unsigned intrepcode = *tempcode;
8000PUT(tempcode, 1,
len);
8036*errorcodeptr =
ERR15;
8046HANDLE_SINGLE_REFERENCE:
8056cb->
backref_map|= (meta_arg < 32)? (1u << meta_arg) : 1;
8075*errorcodeptr =
ERR15;
8078HANDLE_NUMERICAL_RECURSION:
8080PUT(
code, 1, meta_arg);
8082groupsetfirstcu =
FALSE;
8085zerofirstcu = firstcu;
8086zerofirstcuflags = firstcuflags;
8098 gotoGROUP_PROCESS_NOTE_EMPTY;
8122matched_char =
TRUE;
8128zerofirstcu = firstcu;
8129zerofirstcuflags = firstcuflags;
8131zeroreqcuflags = reqcuflags;
8136 #ifdef SUPPORT_UNICODE 8165*errorcodeptr =
ERR99;
8186 #if PCRE2_CODE_UNIT_WIDTH == 32 8205*
code++ = meta_arg;
8216 #ifdef DEBUG_SHOW_PARSED 8217fprintf(stderr,
"** Unrecognized parsed pattern item 0x%.8x\n", *pptr);
8219*errorcodeptr =
ERR89;
8229matched_char =
TRUE;
8236 #ifdef SUPPORT_UNICODE 8242 PRIV(ucd_caseless_sets)[caseset] > 127))
8246*
code++ = caseset;
8248firstcuflags = zerofirstcuflags =
REQ_NONE;
8259CLASS_CASELESS_CHAR:
8264 #ifdef SUPPORT_UNICODE 8265 if(
utf) mclength =
PRIV(ord2utf)(meta, mcbuffer);
else 8292zeroreqcuflags = reqcuflags;
8298 if(mclength == 1 || req_caseopt == 0)
8300firstcu = mcbuffer[0];
8301firstcuflags = req_caseopt;
8308 elsefirstcuflags = reqcuflags =
REQ_NONE;
8316zerofirstcu = firstcu;
8317zerofirstcuflags = firstcuflags;
8319zeroreqcuflags = reqcuflags;
8320 if(mclength == 1 || req_caseopt == 0)
8333reset_caseful =
FALSE;
8396 uint32_tbranchfirstcu, branchreqcu;
8397 uint32_tbranchfirstcuflags, branchreqcuflags;
8406*errorcodeptr=
ERR33;
8415firstcu = reqcu = 0;
8436lookbehindlength =
META_DATA(pptr[-1]);
8437lookbehindminlength = *pptr;
8440 elselookbehindlength = lookbehindminlength = 0;
8450capitem.
number= capnumber;
8451capitem.
next= open_caps;
8453open_caps = &capitem;
8475 if(lookbehind && lookbehindlength > 0)
8478lookbehindminlength == lookbehindlength)
8496 if((branch_return =
8498&branchfirstcu, &branchfirstcuflags, &branchreqcu, &branchreqcuflags,
8499&bc, open_caps, cb, (lengthptr ==
NULL)?
NULL: &length)) == 0)
8504 if(branch_return < 0) okreturn = -1;
8508 if(lengthptr ==
NULL)
8513 if(*last_branch !=
OP_ALT)
8515firstcu = branchfirstcu;
8516firstcuflags = branchfirstcuflags;
8517reqcu = branchreqcu;
8518reqcuflags = branchreqcuflags;
8532 if(firstcuflags != branchfirstcuflags || firstcu != branchfirstcu)
8539reqcuflags = firstcuflags;
8551branchreqcu = branchfirstcu;
8552branchreqcuflags = branchfirstcuflags;
8558reqcu != branchreqcu)
8562reqcu = branchreqcu;
8563reqcuflags |= branchreqcuflags;
8578 if(lengthptr ==
NULL)
8584PUT(last_branch, 1, branch_length);
8586last_branch -= branch_length;
8588 while(branch_length > 0);
8594PUT(
code, 1, (
int)(
code- start_bracket));
8601*firstcuptr = firstcu;
8602*firstcuflagsptr = firstcuflags;
8604*reqcuflagsptr = reqcuflags;
8605 if(lengthptr !=
NULL)
8609*errorcodeptr =
ERR20;
8612*lengthptr += length;
8626 if(lengthptr !=
NULL)
8634PUT(
code, 1, (
int)(
code- last_branch));
8694 intatomcount,
BOOLinassert)
8706 if(!
is_anchored(scode, bracket_map, cb, atomcount, inassert))
8716 uint32_tnew_map = bracket_map | ((
n< 32)? (1u <<
n) : 1);
8717 if(!
is_anchored(scode, new_map, cb, atomcount, inassert))
return FALSE;
8731 if(scode[GET(scode,1)] !=
OP_ALT)
return FALSE;
8732 if(!
is_anchored(scode, bracket_map, cb, atomcount, inassert))
8740 if(!
is_anchored(scode, bracket_map, cb, atomcount + 1, inassert))
8799 intatomcount,
BOOLinassert)
8831 doscode += GET(scode, 1);
while(*scode ==
OP_ALT);
8844 if(!
is_startline(scode, bracket_map, cb, atomcount, inassert))
8854 unsigned intnew_map = bracket_map | ((
n< 32)? (1u <<
n) : 1);
8870 if(!
is_startline(scode, bracket_map, cb, atomcount + 1, inassert))
8982 #ifdef MAYBE_UTF_MULTI 8983 if(
utf)
switch(c)
9041 if(HAS_EXTRALEN(
code[-1]))
code+= GET_EXTRALEN(
code[-1]);
9109 else if(c != d ||
cflags!= dflags)
return0;
9120 if(inassert == 0)
return0;
9122 else if(c != scode[1])
return0;
9133 if(inassert == 0)
return0;
9139 #ifdef SUPPORT_UNICODE 9140 #if PCRE2_CODE_UNIT_WIDTH == 8 9141 if(scode[1] >= 0x80)
return0;
9142 #elif PCRE2_CODE_UNIT_WIDTH == 16 9143 if(scode[1] >= 0xd800 && scode[1] <= 0xdfff)
return0;
9148 else if(c != scode[1])
return0;
9182 unsigned intgroupno,
uint32_ttablecount)
9187 for(
i= 0;
i< tablecount;
i++)
9190 if(crc == 0 && slot[
IMM2_SIZE+length] != 0)
9210 PUT2(slot, 0, groupno);
9325 if(nestlevel == 0 && skiptype ==
PSKIP_ALT)
returnpptr;
9329 if(nestlevel == 0)
returnpptr;
9336meta = (meta >> 16) & 0x7fff;
9373 intbranchlength, branchminlength;
9374 intgrouplength = -1;
9375 intgroupminlength = INT_MAX;
9398branchlength =
get_branchlength(pptrptr, &branchminlength, errcodeptr, lcptr,
9400 if(branchlength < 0)
gotoISNOTFIXED;
9401 if(branchlength > grouplength) grouplength = branchlength;
9402 if(branchminlength < groupminlength) groupminlength = branchminlength;
9403 if(**pptrptr ==
META_KET)
break;
9410gi[1] = groupminlength;
9413*minptr = groupminlength;
9446 intbranchlength = 0;
9447 intbranchminlength = 0;
9448 intgrouplength, groupminlength;
9459 if((*lcptr)++ > 2000)
9461*errcodeptr =
ERR35;
9479itemlength = itemminlength = 1;
9494 if(pptr ==
NULL)
gotoPARSED_SKIP_FAILED;
9502pptr += pptr[1] + 1;
9518itemlength = itemminlength = 1;
9524itemlength = itemminlength = 1;
9526 if(pptr ==
NULL)
gotoPARSED_SKIP_FAILED;
9531itemlength = itemminlength = 1;
9548 if(escape ==
ESC_X)
return-1;
9549 if(escape ==
ESC_R)
9556 #if PCRE2_CODE_UNIT_WIDTH != 32 9559*errcodeptr =
ERR36;
9563itemlength = itemminlength = 1;
9564 if(escape ==
ESC_p|| escape ==
ESC_P) pptr++;
9575 if(*errcodeptr != 0)
return-1;
9641is_dupname = ng->
isdup;
9648*errcodeptr =
ERR15;
9659 gotoRECURSE_OR_BACKREF_LENGTH;
9675 gotoRECURSE_OR_BACKREF_LENGTH;
9688RECURSE_OR_BACKREF_LENGTH:
9692*errcodeptr =
ERR15;
9695 if(group == 0)
gotoISNOTFIXED;
9706 if(gptrend ==
NULL)
gotoPARSED_SKIP_FAILED;
9707 if(pptr > gptr && pptr < gptrend)
gotoISNOTFIXED;
9708 for(
r= recurses;
r!=
NULL;
r=
r->prev)
if(
r->groupptr == gptr)
break;
9709 if(
r!=
NULL)
gotoISNOTFIXED;
9710this_recurse.
prev= recurses;
9720lcptr, group, &this_recurse, cb);
9721 if(grouplength < 0)
9723 if(*errcodeptr == 0)
gotoISNOTFIXED;
9726itemlength = grouplength;
9727itemminlength = groupminlength;
9766lcptr, group, recurses, cb);
9767 if(grouplength < 0)
return-1;
9768itemlength = grouplength;
9769itemminlength = groupminlength;
9792 if(lastitemlength != 0 &&
9794(INT_MAX - branchlength)/lastitemlength <
max- 1)
9796*errcodeptr =
ERR87;
9799 if(
min== 0) branchminlength -= lastitemminlength;
9800 elseitemminlength = (
min- 1) * lastitemminlength;
9801 if(
max== 0) branchlength -= lastitemlength;
9802 elseitemlength = (
max- 1) * lastitemlength;
9811*errcodeptr =
ERR25;
9820 if(INT_MAX - branchlength < (
int)itemlength ||
9823*errcodeptr =
ERR87;
9827branchminlength += itemminlength;
9831lastitemlength = itemlength;
9832lastitemminlength = itemminlength;
9837*minptr = branchminlength;
9838 returnbranchlength;
9841*errcodeptr =
ERR90;
9880 intminlength = INT_MAX;
9892 intbranchlength, branchminlength;
9895branchlength =
get_branchlength(pptrptr, &branchminlength, errcodeptr, lcptr,
9898 if(branchlength < 0)
9901 if(*errcodeptr == 0) *errcodeptr =
ERR25;
9906 if(branchlength != branchminlength) variable =
TRUE;
9907 if(branchminlength < minlength) minlength = branchminlength;
9908 if(branchlength > maxlength) maxlength = branchlength;
9910*bptr |= branchlength;
9924gbptr[1] = minlength;
9989 if(--nestlevel < 0)
9991 if(retptr !=
NULL) *retptr = pptr;
10089pptr += 1 + pptr[1];
10132 BOOLzero_terminated;
10148 uint32_tfirstcuflags, reqcuflags;
10181 if(errorptr ==
NULL|| erroroffset ==
NULL)
return NULL;
10187 if(pattern ==
NULL)
10189 if(patlen == 0) pattern = (
PCRE2_SPTR)
"";
else 10191*errorptr =
ERR16;
10198 if(ccontext ==
NULL)
10210*errorptr =
ERR17;
10218*errorptr =
ERR92;
10226patlen =
PRIV(strlen)(pattern);
10228 if(patlen > ccontext->max_pattern_length)
10230*errorptr =
ERR88;
10240tables = (ccontext->tables !=
NULL)? ccontext->tables :
PRIV(default_tables);
10301#ifdef SUPPORT_VALGRIND
10302 if(zero_terminated) VALGRIND_MAKE_MEM_NOACCESS(pattern + patlen,
CU2BYTES(1));
10310 while(patlen - skipatstart >= 2 &&
10319 if(patlen - skipatstart - 2 >= p->
length&&
10320 PRIV(strncmp_c8)(ptr + skipatstart + 2, (
char*)(p->
name),
10323skipatstart += p->
length+ 2;
10331setflags |= p->
value;
10335newline = p->
value;
10351errorcode =
ERR60;
10353 gotoHAD_EARLY_ERROR;
10358c = c*10 + (ptr[pp++] -
CHAR_0);
10362errorcode =
ERR60;
10364 gotoHAD_EARLY_ERROR;
10368 elselimit_depth = c;
10369skipatstart += pp - skipatstart;
10375 if(
i>=
sizeof(
pso_list)/
sizeof(
pso))
break;
10381ptr += skipatstart;
10385 #ifndef SUPPORT_UNICODE 10388errorcode =
ERR32;
10389 gotoHAD_EARLY_ERROR;
10403errorcode =
ERR74;
10404 gotoHAD_EARLY_ERROR;
10407(errorcode =
PRIV(
valid_utf)(pattern, patlen, erroroffset)) != 0)
10410 #if PCRE2_CODE_UNIT_WIDTH == 16 10413errorcode =
ERR91;
10414 gotoHAD_EARLY_ERROR;
10424errorcode =
ERR75;
10425 gotoHAD_EARLY_ERROR;
10430 if(bsr == 0) bsr = ccontext->bsr_convention;
10434 if(newline == 0) newline = ccontext->newline_convention;
10468errorcode =
ERR56;
10469 gotoHAD_EARLY_ERROR;
10485 #if PCRE2_CODE_UNIT_WIDTH == 32 10499parsed_size_needed = patlen - skipatstart + big32count;
10501 if((ccontext->extra_options &
10503parsed_size_needed += 4;
10506parsed_size_needed = (parsed_size_needed + 1) * 5;
10510 uint32_t*heap_parsed_pattern = ccontext->memctl.malloc(
10511(parsed_size_needed + 1) *
sizeof(
uint32_t), ccontext->memctl.memory_data);
10512 if(heap_parsed_pattern ==
NULL)
10514*errorptr =
ERR21;
10524 if(errorcode != 0)
gotoHAD_CB_ERROR;
10536 if(has_lookbehind)
10541cb.
groupinfo= ccontext->memctl.malloc(
10542(2 * (cb.
bracount+ 1))*
sizeof(
uint32_t), ccontext->memctl.memory_data);
10545errorcode =
ERR21;
10552 if(errorcode != 0)
gotoHAD_CB_ERROR;
10557 #ifdef DEBUG_SHOW_PARSED 10558fprintf(stderr,
"+++ Pre-scan complete:\n");
10564 #ifdef DEBUG_SHOW_CAPTURES 10567fprintf(stderr,
"+++Captures: %d\n", cb.
bracount);
10570fprintf(stderr,
"+++%3d %.*s\n", ng->
number, ng->
length, ng->
name);
10593&errorcode, 0, &firstcu, &firstcuflags, &reqcu, &reqcuflags,
NULL,
NULL,
10596 if(errorcode != 0)
gotoHAD_CB_ERROR;
10600 if(length > MAX_PATTERN_SIZE)
10602errorcode =
ERR20;
10615 if(re_blocksize > ccontext->max_pattern_compiled_length)
10622ccontext->
memctl.
malloc(re_blocksize, ccontext->memctl.memory_data);
10625errorcode =
ERR21;
10636re->
memctl= ccontext->memctl;
10698&pptr, &errorcode, 0, &firstcu, &firstcuflags, &reqcu, &reqcuflags,
NULL,
10718usedlength =
code- codestart;
10719 if(usedlength > length) errorcode =
ERR23;
else 10722 #ifdef SUPPORT_VALGRIND 10723VALGRIND_MAKE_MEM_NOACCESS(
code,
CU2BYTES(length - usedlength));
10731 #define RSCAN_CACHE_SIZE 8 10737 unsigned intccount = 0;
10745 intp, groupnumber;
10747groupnumber = (
int)GET(rcode, 1);
10748 if(groupnumber == 0) rgroup = codestart;
else 10752 for(
i= 0, p = start;
i< ccount;
i++, p = (p + 1) & 7)
10754 if(groupnumber == rc[p].groupnumber)
10756rgroup = rc[p].
group;
10764 if(groupnumber > rc[p].groupnumber) search_from = rc[p].
group;
10767 if(rgroup ==
NULL)
10769rgroup =
PRIV(find_bracket)(search_from,
utf, groupnumber);
10770 if(rgroup ==
NULL)
10772errorcode =
ERR53;
10777rc[start].
group= rgroup;
10782PUT(rcode, 1, rgroup - codestart);
10789 #ifdef DEBUG_CALL_PRINTINT 10791fprintf(stderr,
"Length=%lu Used=%lu\n", length, usedlength);
10804 if(
PRIV(auto_possessify)(temp, &cb) != 0) errorcode =
ERR80;
10809 if(errorcode != 0)
gotoHAD_CB_ERROR;
10830 intminminlength = 0;
10852 if(firstcu < 128 || (!
utf&& !ucp && firstcu < 255))
10861 #ifdef SUPPORT_UNICODE 10862 #if PCRE2_CODE_UNIT_WIDTH == 8 10891 #if PCRE2_CODE_UNIT_WIDTH == 16 10894(firstcu & 0xf800) != 0xd800 ||
10895(reqcu & 0xfc00) != 0xdc00)
10896 #elif PCRE2_CODE_UNIT_WIDTH == 8 10899(firstcu & 0x80) == 0 ||
10900(reqcu & 0x80) == 0)
10919 if(reqcu < 128 || (!
utf&& !ucp && reqcu < 255))
10923 #ifdef SUPPORT_UNICODE 10924 #if PCRE2_CODE_UNIT_WIDTH == 8 10940 if(
PRIV(study)(re) != 0)
10942errorcode =
ERR31;
10965 #ifdef SUPPORT_VALGRIND 10966 if(zero_terminated) VALGRIND_MAKE_MEM_DEFINED(pattern + patlen,
CU2BYTES(1));
10969ccontext->memctl.free(cb.
parsed_pattern, ccontext->memctl.memory_data);
10971ccontext->memctl.free((
void*)cb.
named_groups, ccontext->memctl.memory_data);
10973ccontext->memctl.free((
void*)cb.
groupinfo, ccontext->memctl.memory_data);
10986*erroroffset = ptr - pattern;
10989*errorptr = errorcode;
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
unsigned int
A callback function used to compare two keys in a database.
if(yy_accept[yy_current_state])
int strncmp(const char *str1, const char *str2, size_t count)
#define TRUE
bool replacment for C indicating true.
#define FALSE
bool replacment for C indicating false.
bool ge(T x_, T y_, T round_)
Int4 delta(size_t dimension_, const Int4 *score_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
#define PCRE2_ALLOW_EMPTY_CLASS
#define PCRE2_ZERO_TERMINATED
#define PCRE2_EXTRA_ALT_BSUX
#define PCRE2_BSR_ANYCRLF
#define PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES
#define PCRE2_ALT_VERBNAMES
#define PCRE2_EXTRA_ESCAPED_CR_IS_LF
#define PCRE2_EXTRA_ASCII_POSIX
#define PCRE2_AUTO_CALLOUT
#define PCRE2_NO_AUTO_POSSESS
#define PCRE2_MATCH_INVALID_UTF
#define PCRE2_NEWLINE_ANYCRLF
#define PCRE2_EXTENDED_MORE
#define PCRE2_EXTRA_ASCII_BSS
#define PCRE2_EXTRA_ASCII_BSD
#define PCRE2_MATCH_UNSET_BACKREF
#define PCRE2_NO_DOTSTAR_ANCHOR
#define PCRE2_EXTRA_MATCH_WORD
#define PCRE2_EXTRA_CASELESS_RESTRICT
#define PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL
#define PCRE2_EXTRA_MATCH_LINE
#define PCRE2_CALL_CONVENTION
#define PCRE2_NEWLINE_CRLF
#define PCRE2_NO_AUTO_CAPTURE
#define PCRE2_EXTRA_ASCII_DIGIT
#define PCRE2_NEVER_BACKSLASH_C
#define PCRE2_NEWLINE_NUL
#define PCRE2_EXTRA_ASCII_BSW
#define PCRE2_NO_UTF_CHECK
#define PCRE2_BSR_UNICODE
#define PCRE2_NO_START_OPTIMIZE
#define PCRE2_NEWLINE_ANY
#define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK
#define pcre2_compile_context
static const short int escapes[]
static int parse_regex(PCRE2_SPTR ptr, uint32_t options, BOOL *has_lookbehind, compile_block *cb)
PCRE2_EXPORT pcre2_code *PCRE2_CALL_CONVENTION pcre2_compile(PCRE2_SPTR pattern, PCRE2_SIZE patlen, uint32_t options, int *errorptr, PCRE2_SIZE *erroroffset, pcre2_compile_context *ccontext)
static BOOL read_name(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, BOOL utf, uint32_t terminator, PCRE2_SIZE *offsetptr, PCRE2_SPTR *nameptr, uint32_t *namelenptr, int *errorcodeptr, compile_block *cb)
static BOOL set_lookbehind_lengths(uint32_t **, int *, int *, parsed_recurse_check *, compile_block *)
#define GI_FIXED_LENGTH_MASK
#define PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS
static const verbitem verbs[]
static const uint32_t verbops[]
static unsigned char meta_extra_lengths[]
#define META_LOOKBEHIND_NA
#define META_RANGE_ESCAPED
#define PARSE_TRACKED_OPTIONS
#define PUBLIC_COMPILE_EXTRA_OPTIONS
#define META_COND_VERSION
#define META_LOOKBEHINDNOT
#define META_RANGE_LITERAL
#define META_COND_RNUMBER
static uint32_t * handle_escdsw(int escape, uint32_t *parsed_pattern, uint32_t options, uint32_t xoptions)
#define META_ATOMIC_SCRIPT_RUN
static const int verbcount
#define META_RECURSE_BYNAME
#define META_BACKREF_BYNAME
#define GI_SET_FIXED_LENGTH
static uint32_t * manage_callouts(PCRE2_SPTR ptr, uint32_t **pcalloutptr, BOOL auto_callout, uint32_t *parsed_pattern, compile_block *cb)
#define META_CLASS_EMPTY_NOT
#define PARSED_PATTERN_DEFAULT_SIZE
static int get_branchlength(uint32_t **, int *, int *, int *, parsed_recurse_check *, compile_block *)
#define PUBLIC_COMPILE_OPTIONS
#define META_ASTERISK_QUERY
static BOOL is_anchored(PCRE2_SPTR code, uint32_t bracket_map, compile_block *cb, int atomcount, BOOL inassert)
static unsigned int add_list_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options, uint32_t xoptions, compile_block *cb, const uint32_t *p, unsigned int except)
static BOOL read_number(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, int32_t allow_sign, uint32_t max_value, uint32_t max_error, int *intptr, int *errorcodeptr)
#define META_LOOKAHEAD_NA
#define GI_NOT_FIXED_LENGTH
#define STRING_UTFn_RIGHTPAR
PCRE2_EXPORT pcre2_code *PCRE2_CALL_CONVENTION pcre2_code_copy(const pcre2_code *code)
static const uint8_t opcode_possessify[]
static unsigned int add_not_list_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options, uint32_t xoptions, compile_block *cb, const uint32_t *p)
#define PARSED_LITERAL(c, p)
#define META_LOOKAHEADNOT
static BOOL find_dupname_details(PCRE2_SPTR name, uint32_t length, int *indexptr, int *countptr, int *errorcodeptr, compile_block *cb)
static const PCRE2_UCHAR * first_significant_code(PCRE2_SPTR code, BOOL skipassert)
static const char alasnames[]
static void add_name_to_table(compile_block *cb, PCRE2_SPTR name, int length, unsigned int groupno, uint32_t tablecount)
static uint32_t find_firstassertedcu(PCRE2_SPTR code, uint32_t *flags, uint32_t inassert)
static unsigned int add_to_class(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options, uint32_t xoptions, compile_block *cb, uint32_t start, uint32_t end)
static const int posix_class_maps[]
#define META_ASTERISK_PLUS
static const uint8_t posix_name_lengths[]
#define GETPLUSOFFSET(s, p)
static BOOL check_posix_syntax(PCRE2_SPTR ptr, PCRE2_SPTR ptrend, PCRE2_SPTR *endptr)
static BOOL read_repeat_counts(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t *minp, uint32_t *maxp, int *errorcodeptr)
static int check_posix_name(PCRE2_SPTR ptr, int len)
#define META_CALLOUT_STRING
PCRE2_EXPORT pcre2_code *PCRE2_CALL_CONVENTION pcre2_code_copy_with_tables(const pcre2_code *code)
static int compile_regex(uint32_t, uint32_t, PCRE2_UCHAR **, uint32_t **, int *, uint32_t, uint32_t *, uint32_t *, uint32_t *, uint32_t *, branch_chain *, open_capitem *, compile_block *, PCRE2_SIZE *)
static PCRE2_SPTR find_recurse(PCRE2_SPTR code, BOOL utf)
static const char posix_names[]
#define WORK_SIZE_SAFETY_MARGIN
static const uint8_t xdigitab[]
static BOOL is_startline(PCRE2_SPTR code, unsigned int bracket_map, compile_block *cb, int atomcount, BOOL inassert)
static const char verbnames[]
static const int alascount
#define META_CALLOUT_NUMBER
static int check_lookbehinds(uint32_t *, uint32_t **, parsed_recurse_check *, compile_block *, int *)
#define META_MINMAX_QUERY
#define READPLUSOFFSET(s, p)
#define PARSE_TRACKED_EXTRA_OPTIONS
static const pso pso_list[]
static int compile_branch(uint32_t *optionsptr, uint32_t *xoptionsptr, PCRE2_UCHAR **codeptr, uint32_t **pptrptr, int *errorcodeptr, uint32_t *firstcuptr, uint32_t *firstcuflagsptr, uint32_t *reqcuptr, uint32_t *reqcuflagsptr, branch_chain *bcptr, open_capitem *open_caps, compile_block *cb, PCRE2_SIZE *lengthptr)
#define PUBLIC_LITERAL_COMPILE_OPTIONS
#define COMPILE_WORK_SIZE
PCRE2_EXPORT void PCRE2_CALL_CONVENTION pcre2_code_free(pcre2_code *code)
static const alasitem alasmeta[]
static uint32_t * parsed_skip(uint32_t *pptr, uint32_t skiptype)
#define NAMED_GROUP_LIST_SIZE
struct nest_save nest_save
#define GROUPINFO_DEFAULT_SIZE
static int get_grouplength(uint32_t **pptrptr, int *minptr, BOOL isinline, int *errcodeptr, int *lcptr, int group, parsed_recurse_check *recurses, compile_block *cb)
static uint32_t chartypeoffset[]
static unsigned int add_to_class_internal(uint8_t *classbits, PCRE2_UCHAR **uchardptr, uint32_t options, uint32_t xoptions, compile_block *cb, uint32_t start, uint32_t end)
#define PCRE2_CODE_UNIT_WIDTH
#define CHAR_LESS_THAN_SIGN
#define STRING_CRLF_RIGHTPAR
#define STRING_NUL_RIGHTPAR
#define STRING_BSR_ANYCRLF_RIGHTPAR
#define STRING_WEIRD_STARTWORD
#define STRING_LIMIT_HEAP_EQ
#define PCRE2_FIRSTMAPSET
#define STRING_positive_lookbehind0
#define STRING_NO_AUTO_POSSESS_RIGHTPAR
#define STRING_NO_JIT_RIGHTPAR
#define STRING_NOTEMPTY_ATSTART_RIGHTPAR
#define PCRE2_NE_ATST_SET
#define STRING_non_atomic_positive_lookahead0
#define CHAR_VERTICAL_LINE
#define PCRE2_FIRSTCASELESS
#define CHAR_GRAVE_ACCENT
#define STRING_NO_START_OPT_RIGHTPAR
#define STRING_negative_lookahead0
#define CHAR_LEFT_SQUARE_BRACKET
#define STRING_NOTEMPTY_RIGHTPAR
@ OP_NOT_UCP_WORD_BOUNDARY
#define CHAR_QUESTION_MARK
#define PCRE2_DEREF_TABLES
#define PCRE2_LASTCASELESS
#define CHAR_EXCLAMATION_MARK
#define MAX_UTF_CODE_POINT
#define STRING_scriptextensions
#define CHAR_COMMERCIAL_AT
#define STRING_negative_lookbehind0
#define CHAR_RIGHT_PARENTHESIS
#define STRING_ANYCRLF_RIGHTPAR
#define STRING_CR_RIGHTPAR
#define STRING_non_atomic_positive_lookbehind0
#define CHAR_RIGHT_SQUARE_BRACKET
#define STRING_script_run0
#define CHAR_RIGHT_CURLY_BRACKET
#define CHAR_LEFT_PARENTHESIS
#define CHAR_CIRCUMFLEX_ACCENT
#define CHAR_LEFT_CURLY_BRACKET
#define STRING_LIMIT_MATCH_EQ
#define COMPILE_ERROR_BASE
#define STRING_WEIRD_ENDWORD
#define STRING_UTF_RIGHTPAR
#define STRING_UCP_RIGHTPAR
#define STRING_NO_DOTSTAR_ANCHOR_RIGHTPAR
#define CHAR_GREATER_THAN_SIGN
#define STRING_atomic_script_run
#define UCD_OTHERCASE(ch)
#define PCRE2_MATCH_EMPTY
#define STRING_LIMIT_DEPTH_EQ
#define STRING_ANY_RIGHTPAR
#define STRING_LIMIT_RECURSION_EQ
#define STRING_positive_lookahead0
#define PCRE2_NOTEMPTY_SET
#define STRING_BSR_UNICODE_RIGHTPAR
#define STRING_LF_RIGHTPAR
struct pcre2_real_code pcre2_real_code
#define TABLE_GET(c, table, default)
#define GETCHARINCTEST(c, eptr)
void PRIV() jit_free(void *executable_jit, pcre2_memctl *memctl)
int valid_utf(PCRE2_SPTR8, PCRE2_SIZE, PCRE2_SIZE *)
static const char delimiter[]
PCRE2_UCHAR * current_branch
struct branch_chain * outer
uint32_t * parsed_pattern_end
PCRE2_SIZE workspace_size
uint32_t class_range_start
uint32_t * parsed_pattern
pcre2_real_compile_context * cx
PCRE2_SIZE small_ref_offset[10]
uint32_t max_varlookbehind
uint32_t named_group_list_size
named_group * named_groups
uint32_t external_options
PCRE2_SPTR start_workspace
struct open_capitem * next
struct parsed_recurse_check * prev
void *(* malloc)(size_t, void *)
void(* free)(void *, void *)
uint16_t newline_convention
int(* stack_guard)(uint32_t, void *)
uint32_t parens_nest_limit
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4