| 1113 |
/* Search for a recognized property name using binary chop */ |
/* Search for a recognized property name using binary chop */ |
| 1114 |
|
|
| 1115 |
bot = 0; |
bot = 0; |
| 1116 |
top = _pcre_utt_size; |
top = PRIV(utt_size); |
| 1117 |
|
|
| 1118 |
while (bot < top) |
while (bot < top) |
| 1119 |
{ |
{ |
| 1120 |
i = (bot + top) >> 1; |
i = (bot + top) >> 1; |
| 1121 |
c = STRCMP_UC_C8(name, _pcre_utt_names + _pcre_utt[i].name_offset); |
c = STRCMP_UC_C8(name, PRIV(utt_names) + PRIV(utt)[i].name_offset); |
| 1122 |
if (c == 0) |
if (c == 0) |
| 1123 |
{ |
{ |
| 1124 |
*dptr = _pcre_utt[i].value; |
*dptr = PRIV(utt)[i].value; |
| 1125 |
return _pcre_utt[i].type; |
return PRIV(utt)[i].type; |
| 1126 |
} |
} |
| 1127 |
if (c > 0) bot = i + 1; else top = i; |
if (c > 0) bot = i + 1; else top = i; |
| 1128 |
} |
} |
| 1532 |
case OP_ASSERTBACK_NOT: |
case OP_ASSERTBACK_NOT: |
| 1533 |
if (!skipassert) return code; |
if (!skipassert) return code; |
| 1534 |
do code += GET(code, 1); while (*code == OP_ALT); |
do code += GET(code, 1); while (*code == OP_ALT); |
| 1535 |
code += _pcre_OP_lengths[*code]; |
code += PRIV(OP_lengths)[*code]; |
| 1536 |
break; |
break; |
| 1537 |
|
|
| 1538 |
case OP_WORD_BOUNDARY: |
case OP_WORD_BOUNDARY: |
| 1546 |
case OP_RREF: |
case OP_RREF: |
| 1547 |
case OP_NRREF: |
case OP_NRREF: |
| 1548 |
case OP_DEF: |
case OP_DEF: |
| 1549 |
code += _pcre_OP_lengths[*code]; |
code += PRIV(OP_lengths)[*code]; |
| 1550 |
break; |
break; |
| 1551 |
|
|
| 1552 |
default: |
default: |
| 1670 |
case OP_PRUNE_ARG: |
case OP_PRUNE_ARG: |
| 1671 |
case OP_SKIP_ARG: |
case OP_SKIP_ARG: |
| 1672 |
case OP_THEN_ARG: |
case OP_THEN_ARG: |
| 1673 |
cc += cc[1] + _pcre_OP_lengths[*cc]; |
cc += cc[1] + PRIV(OP_lengths)[*cc]; |
| 1674 |
break; |
break; |
| 1675 |
|
|
| 1676 |
case OP_CALLOUT: |
case OP_CALLOUT: |
| 1697 |
case OP_SOM: |
case OP_SOM: |
| 1698 |
case OP_THEN: |
case OP_THEN: |
| 1699 |
case OP_WORD_BOUNDARY: |
case OP_WORD_BOUNDARY: |
| 1700 |
cc += _pcre_OP_lengths[*cc]; |
cc += PRIV(OP_lengths)[*cc]; |
| 1701 |
break; |
break; |
| 1702 |
|
|
| 1703 |
/* Handle literal characters */ |
/* Handle literal characters */ |
| 1709 |
branchlength++; |
branchlength++; |
| 1710 |
cc += 2; |
cc += 2; |
| 1711 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 1712 |
if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f]; |
if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f]; |
| 1713 |
#endif |
#endif |
| 1714 |
break; |
break; |
| 1715 |
|
|
| 1723 |
branchlength += GET2(cc,1); |
branchlength += GET2(cc,1); |
| 1724 |
cc += 4; |
cc += 4; |
| 1725 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 1726 |
if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f]; |
if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f]; |
| 1727 |
#endif |
#endif |
| 1728 |
break; |
break; |
| 1729 |
|
|
| 1910 |
*/ |
*/ |
| 1911 |
|
|
| 1912 |
const pcre_uchar * |
const pcre_uchar * |
| 1913 |
_pcre_find_bracket(const pcre_uchar *code, BOOL utf8, int number) |
PRIV(find_bracket)(const pcre_uchar *code, BOOL utf8, int number) |
| 1914 |
{ |
{ |
| 1915 |
for (;;) |
for (;;) |
| 1916 |
{ |
{ |
| 1929 |
else if (c == OP_REVERSE) |
else if (c == OP_REVERSE) |
| 1930 |
{ |
{ |
| 1931 |
if (number < 0) return (pcre_uchar *)code; |
if (number < 0) return (pcre_uchar *)code; |
| 1932 |
code += _pcre_OP_lengths[c]; |
code += PRIV(OP_lengths)[c]; |
| 1933 |
} |
} |
| 1934 |
|
|
| 1935 |
/* Handle capturing bracket */ |
/* Handle capturing bracket */ |
| 1939 |
{ |
{ |
| 1940 |
int n = GET2(code, 1+LINK_SIZE); |
int n = GET2(code, 1+LINK_SIZE); |
| 1941 |
if (n == number) return (pcre_uchar *)code; |
if (n == number) return (pcre_uchar *)code; |
| 1942 |
code += _pcre_OP_lengths[c]; |
code += PRIV(OP_lengths)[c]; |
| 1943 |
} |
} |
| 1944 |
|
|
| 1945 |
/* Otherwise, we can get the item's length from the table, except that for |
/* Otherwise, we can get the item's length from the table, except that for |
| 1983 |
|
|
| 1984 |
/* Add in the fixed length from the table */ |
/* Add in the fixed length from the table */ |
| 1985 |
|
|
| 1986 |
code += _pcre_OP_lengths[c]; |
code += PRIV(OP_lengths)[c]; |
| 1987 |
|
|
| 1988 |
/* In UTF-8 mode, opcodes that are followed by a character may be followed by |
/* In UTF-8 mode, opcodes that are followed by a character may be followed by |
| 1989 |
a multi-byte character. The length in the table is a minimum, so we have to |
a multi-byte character. The length in the table is a minimum, so we have to |
| 2020 |
case OP_MINQUERYI: |
case OP_MINQUERYI: |
| 2021 |
case OP_POSQUERY: |
case OP_POSQUERY: |
| 2022 |
case OP_POSQUERYI: |
case OP_POSQUERYI: |
| 2023 |
if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f]; |
if (code[-1] >= 0xc0) code += PRIV(utf8_table4)[code[-1] & 0x3f]; |
| 2024 |
break; |
break; |
| 2025 |
} |
} |
| 2026 |
#else |
#else |
| 2102 |
|
|
| 2103 |
/* Add in the fixed length from the table */ |
/* Add in the fixed length from the table */ |
| 2104 |
|
|
| 2105 |
code += _pcre_OP_lengths[c]; |
code += PRIV(OP_lengths)[c]; |
| 2106 |
|
|
| 2107 |
/* In UTF-8 mode, opcodes that are followed by a character may be followed |
/* In UTF-8 mode, opcodes that are followed by a character may be followed |
| 2108 |
by a multi-byte character. The length in the table is a minimum, so we have |
by a multi-byte character. The length in the table is a minimum, so we have |
| 2139 |
case OP_MINQUERYI: |
case OP_MINQUERYI: |
| 2140 |
case OP_POSQUERY: |
case OP_POSQUERY: |
| 2141 |
case OP_POSQUERYI: |
case OP_POSQUERYI: |
| 2142 |
if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f]; |
if (code[-1] >= 0xc0) code += PRIV(utf8_table4)[code[-1] & 0x3f]; |
| 2143 |
break; |
break; |
| 2144 |
} |
} |
| 2145 |
#else |
#else |
| 2177 |
BOOL utf8, compile_data *cd) |
BOOL utf8, compile_data *cd) |
| 2178 |
{ |
{ |
| 2179 |
register int c; |
register int c; |
| 2180 |
for (code = first_significant_code(code + _pcre_OP_lengths[*code], TRUE); |
for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE); |
| 2181 |
code < endcode; |
code < endcode; |
| 2182 |
code = first_significant_code(code + _pcre_OP_lengths[c], TRUE)) |
code = first_significant_code(code + PRIV(OP_lengths)[c], TRUE)) |
| 2183 |
{ |
{ |
| 2184 |
const pcre_uchar *ccode; |
const pcre_uchar *ccode; |
| 2185 |
|
|
| 2240 |
if (c == OP_BRAZERO || c == OP_BRAMINZERO || c == OP_SKIPZERO || |
if (c == OP_BRAZERO || c == OP_BRAMINZERO || c == OP_SKIPZERO || |
| 2241 |
c == OP_BRAPOSZERO) |
c == OP_BRAPOSZERO) |
| 2242 |
{ |
{ |
| 2243 |
code += _pcre_OP_lengths[c]; |
code += PRIV(OP_lengths)[c]; |
| 2244 |
do code += GET(code, 1); while (*code == OP_ALT); |
do code += GET(code, 1); while (*code == OP_ALT); |
| 2245 |
c = *code; |
c = *code; |
| 2246 |
continue; |
continue; |
| 2296 |
{ |
{ |
| 2297 |
/* Check for quantifiers after a class. XCLASS is used for classes that |
/* Check for quantifiers after a class. XCLASS is used for classes that |
| 2298 |
cannot be represented just by a bit map. This includes negated single |
cannot be represented just by a bit map. This includes negated single |
| 2299 |
high-valued characters. The length in _pcre_OP_lengths[] is zero; the |
high-valued characters. The length in PRIV(OP_lengths)[] is zero; the |
| 2300 |
actual length is stored in the compiled code, so we must update "code" |
actual length is stored in the compiled code, so we must update "code" |
| 2301 |
here. */ |
here. */ |
| 2302 |
|
|
| 2411 |
case OP_MINQUERYI: |
case OP_MINQUERYI: |
| 2412 |
case OP_POSQUERY: |
case OP_POSQUERY: |
| 2413 |
case OP_POSQUERYI: |
case OP_POSQUERYI: |
| 2414 |
if (utf8 && code[1] >= 0xc0) code += _pcre_utf8_table4[code[1] & 0x3f]; |
if (utf8 && code[1] >= 0xc0) code += PRIV(utf8_table4)[code[1] & 0x3f]; |
| 2415 |
break; |
break; |
| 2416 |
|
|
| 2417 |
case OP_UPTO: |
case OP_UPTO: |
| 2420 |
case OP_MINUPTOI: |
case OP_MINUPTOI: |
| 2421 |
case OP_POSUPTO: |
case OP_POSUPTO: |
| 2422 |
case OP_POSUPTOI: |
case OP_POSUPTOI: |
| 2423 |
if (utf8 && code[3] >= 0xc0) code += _pcre_utf8_table4[code[3] & 0x3f]; |
if (utf8 && code[3] >= 0xc0) code += PRIV(utf8_table4)[code[3] & 0x3f]; |
| 2424 |
break; |
break; |
| 2425 |
#endif |
#endif |
| 2426 |
|
|
| 2784 |
prop->chartype == ucp_Lt) == negated; |
prop->chartype == ucp_Lt) == negated; |
| 2785 |
|
|
| 2786 |
case PT_GC: |
case PT_GC: |
| 2787 |
return (pdata == _pcre_ucp_gentype[prop->chartype]) == negated; |
return (pdata == PRIV(ucp_gentype)[prop->chartype]) == negated; |
| 2788 |
|
|
| 2789 |
case PT_PC: |
case PT_PC: |
| 2790 |
return (pdata == prop->chartype) == negated; |
return (pdata == prop->chartype) == negated; |
| 2795 |
/* These are specials */ |
/* These are specials */ |
| 2796 |
|
|
| 2797 |
case PT_ALNUM: |
case PT_ALNUM: |
| 2798 |
return (_pcre_ucp_gentype[prop->chartype] == ucp_L || |
return (PRIV(ucp_gentype)[prop->chartype] == ucp_L || |
| 2799 |
_pcre_ucp_gentype[prop->chartype] == ucp_N) == negated; |
PRIV(ucp_gentype)[prop->chartype] == ucp_N) == negated; |
| 2800 |
|
|
| 2801 |
case PT_SPACE: /* Perl space */ |
case PT_SPACE: /* Perl space */ |
| 2802 |
return (_pcre_ucp_gentype[prop->chartype] == ucp_Z || |
return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z || |
| 2803 |
c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR) |
c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR) |
| 2804 |
== negated; |
== negated; |
| 2805 |
|
|
| 2806 |
case PT_PXSPACE: /* POSIX space */ |
case PT_PXSPACE: /* POSIX space */ |
| 2807 |
return (_pcre_ucp_gentype[prop->chartype] == ucp_Z || |
return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z || |
| 2808 |
c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || |
c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || |
| 2809 |
c == CHAR_FF || c == CHAR_CR) |
c == CHAR_FF || c == CHAR_CR) |
| 2810 |
== negated; |
== negated; |
| 2811 |
|
|
| 2812 |
case PT_WORD: |
case PT_WORD: |
| 2813 |
return (_pcre_ucp_gentype[prop->chartype] == ucp_L || |
return (PRIV(ucp_gentype)[prop->chartype] == ucp_L || |
| 2814 |
_pcre_ucp_gentype[prop->chartype] == ucp_N || |
PRIV(ucp_gentype)[prop->chartype] == ucp_N || |
| 2815 |
c == CHAR_UNDERSCORE) == negated; |
c == CHAR_UNDERSCORE) == negated; |
| 2816 |
} |
} |
| 2817 |
return FALSE; |
return FALSE; |
| 3898 |
{ |
{ |
| 3899 |
class_utf8 = TRUE; |
class_utf8 = TRUE; |
| 3900 |
*class_utf8data++ = XCL_SINGLE; |
*class_utf8data++ = XCL_SINGLE; |
| 3901 |
class_utf8data += _pcre_ord2utf8(0x1680, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x1680, class_utf8data); |
| 3902 |
*class_utf8data++ = XCL_SINGLE; |
*class_utf8data++ = XCL_SINGLE; |
| 3903 |
class_utf8data += _pcre_ord2utf8(0x180e, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x180e, class_utf8data); |
| 3904 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3905 |
class_utf8data += _pcre_ord2utf8(0x2000, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x2000, class_utf8data); |
| 3906 |
class_utf8data += _pcre_ord2utf8(0x200A, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x200A, class_utf8data); |
| 3907 |
*class_utf8data++ = XCL_SINGLE; |
*class_utf8data++ = XCL_SINGLE; |
| 3908 |
class_utf8data += _pcre_ord2utf8(0x202f, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x202f, class_utf8data); |
| 3909 |
*class_utf8data++ = XCL_SINGLE; |
*class_utf8data++ = XCL_SINGLE; |
| 3910 |
class_utf8data += _pcre_ord2utf8(0x205f, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x205f, class_utf8data); |
| 3911 |
*class_utf8data++ = XCL_SINGLE; |
*class_utf8data++ = XCL_SINGLE; |
| 3912 |
class_utf8data += _pcre_ord2utf8(0x3000, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x3000, class_utf8data); |
| 3913 |
} |
} |
| 3914 |
#endif |
#endif |
| 3915 |
continue; |
continue; |
| 3933 |
{ |
{ |
| 3934 |
class_utf8 = TRUE; |
class_utf8 = TRUE; |
| 3935 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3936 |
class_utf8data += _pcre_ord2utf8(0x0100, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x0100, class_utf8data); |
| 3937 |
class_utf8data += _pcre_ord2utf8(0x167f, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x167f, class_utf8data); |
| 3938 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3939 |
class_utf8data += _pcre_ord2utf8(0x1681, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x1681, class_utf8data); |
| 3940 |
class_utf8data += _pcre_ord2utf8(0x180d, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x180d, class_utf8data); |
| 3941 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3942 |
class_utf8data += _pcre_ord2utf8(0x180f, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x180f, class_utf8data); |
| 3943 |
class_utf8data += _pcre_ord2utf8(0x1fff, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x1fff, class_utf8data); |
| 3944 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3945 |
class_utf8data += _pcre_ord2utf8(0x200B, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x200B, class_utf8data); |
| 3946 |
class_utf8data += _pcre_ord2utf8(0x202e, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x202e, class_utf8data); |
| 3947 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3948 |
class_utf8data += _pcre_ord2utf8(0x2030, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x2030, class_utf8data); |
| 3949 |
class_utf8data += _pcre_ord2utf8(0x205e, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x205e, class_utf8data); |
| 3950 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3951 |
class_utf8data += _pcre_ord2utf8(0x2060, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x2060, class_utf8data); |
| 3952 |
class_utf8data += _pcre_ord2utf8(0x2fff, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x2fff, class_utf8data); |
| 3953 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3954 |
class_utf8data += _pcre_ord2utf8(0x3001, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x3001, class_utf8data); |
| 3955 |
class_utf8data += _pcre_ord2utf8(0x7fffffff, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x7fffffff, class_utf8data); |
| 3956 |
} |
} |
| 3957 |
#endif |
#endif |
| 3958 |
continue; |
continue; |
| 3968 |
{ |
{ |
| 3969 |
class_utf8 = TRUE; |
class_utf8 = TRUE; |
| 3970 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3971 |
class_utf8data += _pcre_ord2utf8(0x2028, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x2028, class_utf8data); |
| 3972 |
class_utf8data += _pcre_ord2utf8(0x2029, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x2029, class_utf8data); |
| 3973 |
} |
} |
| 3974 |
#endif |
#endif |
| 3975 |
continue; |
continue; |
| 3996 |
{ |
{ |
| 3997 |
class_utf8 = TRUE; |
class_utf8 = TRUE; |
| 3998 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 3999 |
class_utf8data += _pcre_ord2utf8(0x0100, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x0100, class_utf8data); |
| 4000 |
class_utf8data += _pcre_ord2utf8(0x2027, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x2027, class_utf8data); |
| 4001 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 4002 |
class_utf8data += _pcre_ord2utf8(0x2029, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x2029, class_utf8data); |
| 4003 |
class_utf8data += _pcre_ord2utf8(0x7fffffff, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(0x7fffffff, class_utf8data); |
| 4004 |
} |
} |
| 4005 |
#endif |
#endif |
| 4006 |
continue; |
continue; |
| 4178 |
else |
else |
| 4179 |
{ |
{ |
| 4180 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 4181 |
class_utf8data += _pcre_ord2utf8(occ, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(occ, class_utf8data); |
| 4182 |
} |
} |
| 4183 |
class_utf8data += _pcre_ord2utf8(ocd, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(ocd, class_utf8data); |
| 4184 |
} |
} |
| 4185 |
} |
} |
| 4186 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
| 4189 |
overlapping ranges. */ |
overlapping ranges. */ |
| 4190 |
|
|
| 4191 |
*class_utf8data++ = XCL_RANGE; |
*class_utf8data++ = XCL_RANGE; |
| 4192 |
class_utf8data += _pcre_ord2utf8(c, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(c, class_utf8data); |
| 4193 |
class_utf8data += _pcre_ord2utf8(d, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(d, class_utf8data); |
| 4194 |
|
|
| 4195 |
/* With UCP support, we are done. Without UCP support, there is no |
/* With UCP support, we are done. Without UCP support, there is no |
| 4196 |
caseless matching for UTF-8 characters > 127; we can use the bit map |
caseless matching for UTF-8 characters > 127; we can use the bit map |
| 4244 |
{ |
{ |
| 4245 |
class_utf8 = TRUE; |
class_utf8 = TRUE; |
| 4246 |
*class_utf8data++ = XCL_SINGLE; |
*class_utf8data++ = XCL_SINGLE; |
| 4247 |
class_utf8data += _pcre_ord2utf8(c, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(c, class_utf8data); |
| 4248 |
|
|
| 4249 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 4250 |
if ((options & PCRE_CASELESS) != 0) |
if ((options & PCRE_CASELESS) != 0) |
| 4253 |
if ((othercase = UCD_OTHERCASE(c)) != c) |
if ((othercase = UCD_OTHERCASE(c)) != c) |
| 4254 |
{ |
{ |
| 4255 |
*class_utf8data++ = XCL_SINGLE; |
*class_utf8data++ = XCL_SINGLE; |
| 4256 |
class_utf8data += _pcre_ord2utf8(othercase, class_utf8data); |
class_utf8data += PRIV(ord2utf8)(othercase, class_utf8data); |
| 4257 |
} |
} |
| 4258 |
} |
} |
| 4259 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
| 4334 |
|
|
| 4335 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 4336 |
if (utf8 && class_lastchar > 127) |
if (utf8 && class_lastchar > 127) |
| 4337 |
mclength = _pcre_ord2utf8(class_lastchar, mcbuffer); |
mclength = PRIV(ord2utf8)(class_lastchar, mcbuffer); |
| 4338 |
else |
else |
| 4339 |
#endif |
#endif |
| 4340 |
{ |
{ |
| 5180 |
int len; |
int len; |
| 5181 |
|
|
| 5182 |
if (*tempcode == OP_TYPEEXACT) |
if (*tempcode == OP_TYPEEXACT) |
| 5183 |
tempcode += _pcre_OP_lengths[*tempcode] + |
tempcode += PRIV(OP_lengths)[*tempcode] + |
| 5184 |
((tempcode[3] == OP_PROP || tempcode[3] == OP_NOTPROP)? 2 : 0); |
((tempcode[3] == OP_PROP || tempcode[3] == OP_NOTPROP)? 2 : 0); |
| 5185 |
|
|
| 5186 |
else if (*tempcode == OP_EXACT || *tempcode == OP_NOTEXACT) |
else if (*tempcode == OP_EXACT || *tempcode == OP_NOTEXACT) |
| 5187 |
{ |
{ |
| 5188 |
tempcode += _pcre_OP_lengths[*tempcode]; |
tempcode += PRIV(OP_lengths)[*tempcode]; |
| 5189 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 5190 |
if (utf8 && tempcode[-1] >= 0xc0) |
if (utf8 && tempcode[-1] >= 0xc0) |
| 5191 |
tempcode += _pcre_utf8_table4[tempcode[-1] & 0x3f]; |
tempcode += PRIV(utf8_table4)[tempcode[-1] & 0x3f]; |
| 5192 |
#endif |
#endif |
| 5193 |
} |
} |
| 5194 |
|
|
| 6010 |
{ |
{ |
| 6011 |
*code = OP_END; |
*code = OP_END; |
| 6012 |
if (recno != 0) |
if (recno != 0) |
| 6013 |
called = _pcre_find_bracket(cd->start_code, utf8, recno); |
called = PRIV(find_bracket)(cd->start_code, utf8, recno); |
| 6014 |
|
|
| 6015 |
/* Forward reference */ |
/* Forward reference */ |
| 6016 |
|
|
| 6551 |
|
|
| 6552 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 6553 |
if (utf8 && c > 127) |
if (utf8 && c > 127) |
| 6554 |
mclength = _pcre_ord2utf8(c, mcbuffer); |
mclength = PRIV(ord2utf8)(c, mcbuffer); |
| 6555 |
else |
else |
| 6556 |
#endif |
#endif |
| 6557 |
|
|
| 6984 |
{ |
{ |
| 6985 |
do { |
do { |
| 6986 |
const pcre_uchar *scode = first_significant_code( |
const pcre_uchar *scode = first_significant_code( |
| 6987 |
code + _pcre_OP_lengths[*code], FALSE); |
code + PRIV(OP_lengths)[*code], FALSE); |
| 6988 |
register int op = *scode; |
register int op = *scode; |
| 6989 |
|
|
| 6990 |
/* Non-capturing brackets */ |
/* Non-capturing brackets */ |
| 7061 |
{ |
{ |
| 7062 |
do { |
do { |
| 7063 |
const pcre_uchar *scode = first_significant_code( |
const pcre_uchar *scode = first_significant_code( |
| 7064 |
code + _pcre_OP_lengths[*code], FALSE); |
code + PRIV(OP_lengths)[*code], FALSE); |
| 7065 |
register int op = *scode; |
register int op = *scode; |
| 7066 |
|
|
| 7067 |
/* If we are at the start of a conditional assertion group, *both* the |
/* If we are at the start of a conditional assertion group, *both* the |
| 7072 |
if (op == OP_COND) |
if (op == OP_COND) |
| 7073 |
{ |
{ |
| 7074 |
scode += 1 + LINK_SIZE; |
scode += 1 + LINK_SIZE; |
| 7075 |
if (*scode == OP_CALLOUT) scode += _pcre_OP_lengths[OP_CALLOUT]; |
if (*scode == OP_CALLOUT) scode += PRIV(OP_lengths)[OP_CALLOUT]; |
| 7076 |
switch (*scode) |
switch (*scode) |
| 7077 |
{ |
{ |
| 7078 |
case OP_CREF: |
case OP_CREF: |
| 7325 |
|
|
| 7326 |
/* Set up pointers to the individual character tables */ |
/* Set up pointers to the individual character tables */ |
| 7327 |
|
|
| 7328 |
if (tables == NULL) tables = _pcre_default_tables; |
if (tables == NULL) tables = PRIV(default_tables); |
| 7329 |
cd->lcc = tables + lcc_offset; |
cd->lcc = tables + lcc_offset; |
| 7330 |
cd->fcc = tables + fcc_offset; |
cd->fcc = tables + fcc_offset; |
| 7331 |
cd->cbits = tables + cbits_offset; |
cd->cbits = tables + cbits_offset; |
| 7381 |
utf8 = (options & PCRE_UTF8) != 0; |
utf8 = (options & PCRE_UTF8) != 0; |
| 7382 |
|
|
| 7383 |
/* Can't support UTF8 unless PCRE has been compiled to include the code. The |
/* Can't support UTF8 unless PCRE has been compiled to include the code. The |
| 7384 |
return of an error code from _pcre_valid_utf8() is a new feature, introduced in |
return of an error code from PRIV(valid_utf8)() is a new feature, introduced in |
| 7385 |
release 8.13. It is passed back from pcre_[dfa_]exec(), but at the moment is |
release 8.13. It is passed back from pcre_[dfa_]exec(), but at the moment is |
| 7386 |
not used here. */ |
not used here. */ |
| 7387 |
|
|
| 7388 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 7389 |
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 && |
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 && |
| 7390 |
(errorcode = _pcre_valid_utf8((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0) |
(errorcode = PRIV(valid_utf8)((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0) |
| 7391 |
{ |
{ |
| 7392 |
errorcode = ERR44; |
errorcode = ERR44; |
| 7393 |
goto PCRE_EARLY_ERROR_RETURN2; |
goto PCRE_EARLY_ERROR_RETURN2; |
| 7545 |
re->name_entry_size = cd->name_entry_size; |
re->name_entry_size = cd->name_entry_size; |
| 7546 |
re->name_count = cd->names_found; |
re->name_count = cd->names_found; |
| 7547 |
re->ref_count = 0; |
re->ref_count = 0; |
| 7548 |
re->tables = (tables == _pcre_default_tables)? NULL : tables; |
re->tables = (tables == PRIV(default_tables))? NULL : tables; |
| 7549 |
re->nullpad = NULL; |
re->nullpad = NULL; |
| 7550 |
|
|
| 7551 |
/* The starting points of the name/number translation table and of the code are |
/* The starting points of the name/number translation table and of the code are |
| 7605 |
cd->hwm -= LINK_SIZE; |
cd->hwm -= LINK_SIZE; |
| 7606 |
offset = GET(cd->hwm, 0); |
offset = GET(cd->hwm, 0); |
| 7607 |
recno = GET(codestart, offset); |
recno = GET(codestart, offset); |
| 7608 |
groupptr = _pcre_find_bracket(codestart, utf8, recno); |
groupptr = PRIV(find_bracket)(codestart, utf8, recno); |
| 7609 |
if (groupptr == NULL) errorcode = ERR53; |
if (groupptr == NULL) errorcode = ERR53; |
| 7610 |
else PUT(((pcre_uchar *)codestart), offset, (int)(groupptr - codestart)); |
else PUT(((pcre_uchar *)codestart), offset, (int)(groupptr - codestart)); |
| 7611 |
} |
} |
| 7632 |
of zero, but that is a pathological case, and it does no harm.) When we find |
of zero, but that is a pathological case, and it does no harm.) When we find |
| 7633 |
one, we temporarily terminate the branch it is in while we scan it. */ |
one, we temporarily terminate the branch it is in while we scan it. */ |
| 7634 |
|
|
| 7635 |
for (cc = (pcre_uchar *)_pcre_find_bracket(codestart, utf8, -1); |
for (cc = (pcre_uchar *)PRIV(find_bracket)(codestart, utf8, -1); |
| 7636 |
cc != NULL; |
cc != NULL; |
| 7637 |
cc = (pcre_uchar *)_pcre_find_bracket(cc, utf8, -1)) |
cc = (pcre_uchar *)PRIV(find_bracket)(cc, utf8, -1)) |
| 7638 |
{ |
{ |
| 7639 |
if (GET(cc, 1) == 0) |
if (GET(cc, 1) == 0) |
| 7640 |
{ |
{ |