567 |
#endif /* Not SUPPORT_UCP */ |
#endif /* Not SUPPORT_UCP */ |
568 |
return p; |
return p; |
569 |
} |
} |
570 |
#else /* Not SUPPORT_UTF */ |
#else /* Not SUPPORT_UTF */ |
571 |
(void)(utf); /* Stops warning for unused parameter */ |
(void)(utf); /* Stops warning for unused parameter */ |
572 |
#endif |
#endif /* SUPPORT_UTF */ |
573 |
|
|
574 |
/* Not UTF-8 mode, or character is less than 127. */ |
/* Not UTF-8 mode, or character is less than 127. */ |
575 |
|
|
576 |
if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]); |
if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]); |
577 |
return p + 1; |
return p + 1; |
578 |
#endif |
#endif /* COMPILE_PCRE8 */ |
579 |
|
|
580 |
#ifdef COMPILE_PCRE16 |
#ifdef COMPILE_PCRE16 |
581 |
if (c > 0xff) |
if (c > 0xff) |
597 |
c = 0xff; |
c = 0xff; |
598 |
SET_BIT(c); |
SET_BIT(c); |
599 |
} |
} |
600 |
#endif |
#endif /* SUPPORT_UCP */ |
601 |
return p; |
return p; |
602 |
} |
} |
603 |
#endif |
#else /* Not SUPPORT_UTF */ |
604 |
|
(void)(utf); /* Stops warning for unused parameter */ |
605 |
|
#endif /* SUPPORT_UTF */ |
606 |
|
|
607 |
if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]); |
if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]); |
608 |
return p + 1; |
return p + 1; |
990 |
identical. */ |
identical. */ |
991 |
|
|
992 |
case OP_HSPACE: |
case OP_HSPACE: |
993 |
SET_BIT(0x09); |
SET_BIT(CHAR_HT); |
994 |
SET_BIT(0x20); |
SET_BIT(CHAR_SPACE); |
995 |
#ifdef SUPPORT_UTF |
#ifdef SUPPORT_UTF |
996 |
if (utf) |
if (utf) |
997 |
{ |
{ |
1000 |
SET_BIT(0xE1); /* For U+1680, U+180E */ |
SET_BIT(0xE1); /* For U+1680, U+180E */ |
1001 |
SET_BIT(0xE2); /* For U+2000 - U+200A, U+202F, U+205F */ |
SET_BIT(0xE2); /* For U+2000 - U+200A, U+202F, U+205F */ |
1002 |
SET_BIT(0xE3); /* For U+3000 */ |
SET_BIT(0xE3); /* For U+3000 */ |
1003 |
#endif |
#endif /* COMPILE_PCRE8 */ |
1004 |
#ifdef COMPILE_PCRE16 |
#ifdef COMPILE_PCRE16 |
1005 |
SET_BIT(0xA0); |
SET_BIT(0xA0); |
1006 |
SET_BIT(0xFF); /* For characters > 255 */ |
SET_BIT(0xFF); /* For characters > 255 */ |
1007 |
#endif |
#endif /* COMPILE_PCRE16 */ |
1008 |
} |
} |
1009 |
else |
else |
1010 |
#endif /* SUPPORT_UTF */ |
#endif /* SUPPORT_UTF */ |
1011 |
{ |
{ |
1012 |
|
#ifndef EBCDIC |
1013 |
SET_BIT(0xA0); |
SET_BIT(0xA0); |
1014 |
|
#endif /* Not EBCDIC */ |
1015 |
#ifdef COMPILE_PCRE16 |
#ifdef COMPILE_PCRE16 |
1016 |
SET_BIT(0xFF); /* For characters > 255 */ |
SET_BIT(0xFF); /* For characters > 255 */ |
1017 |
#endif |
#endif /* COMPILE_PCRE16 */ |
1018 |
} |
} |
1019 |
try_next = FALSE; |
try_next = FALSE; |
1020 |
break; |
break; |
1021 |
|
|
1022 |
case OP_ANYNL: |
case OP_ANYNL: |
1023 |
case OP_VSPACE: |
case OP_VSPACE: |
1024 |
SET_BIT(0x0A); |
SET_BIT(CHAR_LF); |
1025 |
SET_BIT(0x0B); |
SET_BIT(CHAR_VT); |
1026 |
SET_BIT(0x0C); |
SET_BIT(CHAR_FF); |
1027 |
SET_BIT(0x0D); |
SET_BIT(CHAR_CR); |
1028 |
#ifdef SUPPORT_UTF |
#ifdef SUPPORT_UTF |
1029 |
if (utf) |
if (utf) |
1030 |
{ |
{ |
1031 |
#ifdef COMPILE_PCRE8 |
#ifdef COMPILE_PCRE8 |
1032 |
SET_BIT(0xC2); /* For U+0085 */ |
SET_BIT(0xC2); /* For U+0085 */ |
1033 |
SET_BIT(0xE2); /* For U+2028, U+2029 */ |
SET_BIT(0xE2); /* For U+2028, U+2029 */ |
1034 |
#endif |
#endif /* COMPILE_PCRE8 */ |
1035 |
#ifdef COMPILE_PCRE16 |
#ifdef COMPILE_PCRE16 |
1036 |
SET_BIT(0x85); |
SET_BIT(CHAR_NEL); |
1037 |
SET_BIT(0xFF); /* For characters > 255 */ |
SET_BIT(0xFF); /* For characters > 255 */ |
1038 |
#endif |
#endif /* COMPILE_PCRE16 */ |
1039 |
} |
} |
1040 |
else |
else |
1041 |
#endif /* SUPPORT_UTF */ |
#endif /* SUPPORT_UTF */ |
1042 |
{ |
{ |
1043 |
SET_BIT(0x85); |
SET_BIT(CHAR_NEL); |
1044 |
#ifdef COMPILE_PCRE16 |
#ifdef COMPILE_PCRE16 |
1045 |
SET_BIT(0xFF); /* For characters > 255 */ |
SET_BIT(0xFF); /* For characters > 255 */ |
1046 |
#endif |
#endif |
1064 |
break; |
break; |
1065 |
|
|
1066 |
/* The cbit_space table has vertical tab as whitespace; we have to |
/* The cbit_space table has vertical tab as whitespace; we have to |
1067 |
ensure it is set as not whitespace. */ |
ensure it is set as not whitespace. Luckily, the code value is the same |
1068 |
|
(0x0b) in ASCII and EBCDIC, so we can just adjust the appropriate bit. */ |
1069 |
|
|
1070 |
case OP_NOT_WHITESPACE: |
case OP_NOT_WHITESPACE: |
1071 |
set_nottype_bits(start_bits, cbit_space, table_limit, cd); |
set_nottype_bits(start_bits, cbit_space, table_limit, cd); |
1073 |
try_next = FALSE; |
try_next = FALSE; |
1074 |
break; |
break; |
1075 |
|
|
1076 |
/* The cbit_space table has vertical tab as whitespace; we have to |
/* The cbit_space table has vertical tab as whitespace; we have to not |
1077 |
not set it from the table. */ |
set it from the table. Luckily, the code value is the same (0x0b) in |
1078 |
|
ASCII and EBCDIC, so we can just adjust the appropriate bit. */ |
1079 |
|
|
1080 |
case OP_WHITESPACE: |
case OP_WHITESPACE: |
1081 |
c = start_bits[1]; /* Save in case it was already set */ |
c = start_bits[1]; /* Save in case it was already set */ |
1129 |
return SSB_FAIL; |
return SSB_FAIL; |
1130 |
|
|
1131 |
case OP_HSPACE: |
case OP_HSPACE: |
1132 |
SET_BIT(0x09); |
SET_BIT(CHAR_HT); |
1133 |
SET_BIT(0x20); |
SET_BIT(CHAR_SPACE); |
1134 |
#ifdef SUPPORT_UTF |
#ifdef SUPPORT_UTF |
1135 |
if (utf) |
if (utf) |
1136 |
{ |
{ |
1139 |
SET_BIT(0xE1); /* For U+1680, U+180E */ |
SET_BIT(0xE1); /* For U+1680, U+180E */ |
1140 |
SET_BIT(0xE2); /* For U+2000 - U+200A, U+202F, U+205F */ |
SET_BIT(0xE2); /* For U+2000 - U+200A, U+202F, U+205F */ |
1141 |
SET_BIT(0xE3); /* For U+3000 */ |
SET_BIT(0xE3); /* For U+3000 */ |
1142 |
#endif |
#endif /* COMPILE_PCRE8 */ |
1143 |
#ifdef COMPILE_PCRE16 |
#ifdef COMPILE_PCRE16 |
1144 |
SET_BIT(0xA0); |
SET_BIT(0xA0); |
1145 |
SET_BIT(0xFF); /* For characters > 255 */ |
SET_BIT(0xFF); /* For characters > 255 */ |
1146 |
#endif |
#endif /* COMPILE_PCRE16 */ |
1147 |
} |
} |
1148 |
else |
else |
1149 |
#endif /* SUPPORT_UTF */ |
#endif /* SUPPORT_UTF */ |
1150 |
|
#ifndef EBCDIC |
1151 |
SET_BIT(0xA0); |
SET_BIT(0xA0); |
1152 |
|
#endif /* Not EBCDIC */ |
1153 |
break; |
break; |
1154 |
|
|
1155 |
case OP_ANYNL: |
case OP_ANYNL: |
1156 |
case OP_VSPACE: |
case OP_VSPACE: |
1157 |
SET_BIT(0x0A); |
SET_BIT(CHAR_LF); |
1158 |
SET_BIT(0x0B); |
SET_BIT(CHAR_VT); |
1159 |
SET_BIT(0x0C); |
SET_BIT(CHAR_FF); |
1160 |
SET_BIT(0x0D); |
SET_BIT(CHAR_CR); |
1161 |
#ifdef SUPPORT_UTF |
#ifdef SUPPORT_UTF |
1162 |
if (utf) |
if (utf) |
1163 |
{ |
{ |
1164 |
#ifdef COMPILE_PCRE8 |
#ifdef COMPILE_PCRE8 |
1165 |
SET_BIT(0xC2); /* For U+0085 */ |
SET_BIT(0xC2); /* For U+0085 */ |
1166 |
SET_BIT(0xE2); /* For U+2028, U+2029 */ |
SET_BIT(0xE2); /* For U+2028, U+2029 */ |
1167 |
#endif |
#endif /* COMPILE_PCRE8 */ |
1168 |
#ifdef COMPILE_PCRE16 |
#ifdef COMPILE_PCRE16 |
1169 |
SET_BIT(0x85); |
SET_BIT(CHAR_NEL); |
1170 |
SET_BIT(0xFF); /* For characters > 255 */ |
SET_BIT(0xFF); /* For characters > 255 */ |
1171 |
#endif |
#endif /* COMPILE_PCRE16 */ |
1172 |
} |
} |
1173 |
else |
else |
1174 |
#endif /* SUPPORT_UTF */ |
#endif /* SUPPORT_UTF */ |
1175 |
SET_BIT(0x85); |
SET_BIT(CHAR_NEL); |
1176 |
break; |
break; |
1177 |
|
|
1178 |
case OP_NOT_DIGIT: |
case OP_NOT_DIGIT: |
1184 |
break; |
break; |
1185 |
|
|
1186 |
/* The cbit_space table has vertical tab as whitespace; we have to |
/* The cbit_space table has vertical tab as whitespace; we have to |
1187 |
ensure it gets set as not whitespace. */ |
ensure it gets set as not whitespace. Luckily, the code value is the |
1188 |
|
same (0x0b) in ASCII and EBCDIC, so we can just adjust the appropriate |
1189 |
|
bit. */ |
1190 |
|
|
1191 |
case OP_NOT_WHITESPACE: |
case OP_NOT_WHITESPACE: |
1192 |
set_nottype_bits(start_bits, cbit_space, table_limit, cd); |
set_nottype_bits(start_bits, cbit_space, table_limit, cd); |
1194 |
break; |
break; |
1195 |
|
|
1196 |
/* The cbit_space table has vertical tab as whitespace; we have to |
/* The cbit_space table has vertical tab as whitespace; we have to |
1197 |
avoid setting it. */ |
avoid setting it. Luckily, the code value is the same (0x0b) in ASCII |
1198 |
|
and EBCDIC, so we can just adjust the appropriate bit. */ |
1199 |
|
|
1200 |
case OP_WHITESPACE: |
case OP_WHITESPACE: |
1201 |
c = start_bits[1]; /* Save in case it was already set */ |
c = start_bits[1]; /* Save in case it was already set */ |