512 |
const uschar *code; |
const uschar *code; |
513 |
int state_offset = current_state->offset; |
int state_offset = current_state->offset; |
514 |
int count, codevalue; |
int count, codevalue; |
|
#ifdef SUPPORT_UCP |
|
|
int chartype, script; |
|
|
#endif |
|
515 |
|
|
516 |
#ifdef DEBUG |
#ifdef DEBUG |
517 |
printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset); |
printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset); |
822 |
if (clen > 0) |
if (clen > 0) |
823 |
{ |
{ |
824 |
BOOL OK; |
BOOL OK; |
825 |
int category = _pcre_ucp_findprop(c, &chartype, &script); |
const ucd_record * prop = GET_UCD(c); |
826 |
switch(code[1]) |
switch(code[1]) |
827 |
{ |
{ |
828 |
case PT_ANY: |
case PT_ANY: |
830 |
break; |
break; |
831 |
|
|
832 |
case PT_LAMP: |
case PT_LAMP: |
833 |
OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt; |
OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt; |
834 |
break; |
break; |
835 |
|
|
836 |
case PT_GC: |
case PT_GC: |
837 |
OK = category == code[2]; |
OK = ucp_gentype[prop->chartype] == code[2]; |
838 |
break; |
break; |
839 |
|
|
840 |
case PT_PC: |
case PT_PC: |
841 |
OK = chartype == code[2]; |
OK = prop->chartype == code[2]; |
842 |
break; |
break; |
843 |
|
|
844 |
case PT_SC: |
case PT_SC: |
845 |
OK = script == code[2]; |
OK = prop->script == code[2]; |
846 |
break; |
break; |
847 |
|
|
848 |
/* Should never occur, but keep compilers from grumbling. */ |
/* Should never occur, but keep compilers from grumbling. */ |
991 |
if (clen > 0) |
if (clen > 0) |
992 |
{ |
{ |
993 |
BOOL OK; |
BOOL OK; |
994 |
int category = _pcre_ucp_findprop(c, &chartype, &script); |
const ucd_record * prop = GET_UCD(c); |
995 |
switch(code[2]) |
switch(code[2]) |
996 |
{ |
{ |
997 |
case PT_ANY: |
case PT_ANY: |
999 |
break; |
break; |
1000 |
|
|
1001 |
case PT_LAMP: |
case PT_LAMP: |
1002 |
OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt; |
OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt; |
1003 |
break; |
break; |
1004 |
|
|
1005 |
case PT_GC: |
case PT_GC: |
1006 |
OK = category == code[3]; |
OK = ucp_gentype[prop->chartype] == code[3]; |
1007 |
break; |
break; |
1008 |
|
|
1009 |
case PT_PC: |
case PT_PC: |
1010 |
OK = chartype == code[3]; |
OK = prop->chartype == code[3]; |
1011 |
break; |
break; |
1012 |
|
|
1013 |
case PT_SC: |
case PT_SC: |
1014 |
OK = script == code[3]; |
OK = prop->script == code[3]; |
1015 |
break; |
break; |
1016 |
|
|
1017 |
/* Should never occur, but keep compilers from grumbling. */ |
/* Should never occur, but keep compilers from grumbling. */ |
1040 |
case OP_EXTUNI_EXTRA + OP_TYPEPOSPLUS: |
case OP_EXTUNI_EXTRA + OP_TYPEPOSPLUS: |
1041 |
count = current_state->count; /* Already matched */ |
count = current_state->count; /* Already matched */ |
1042 |
if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); } |
if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); } |
1043 |
if (clen > 0 && _pcre_ucp_findprop(c, &chartype, &script) != ucp_M) |
if (clen > 0 && UCD_CATEGORY(c) != ucp_M) |
1044 |
{ |
{ |
1045 |
const uschar *nptr = ptr + clen; |
const uschar *nptr = ptr + clen; |
1046 |
int ncount = 0; |
int ncount = 0; |
1054 |
int nd; |
int nd; |
1055 |
int ndlen = 1; |
int ndlen = 1; |
1056 |
GETCHARLEN(nd, nptr, ndlen); |
GETCHARLEN(nd, nptr, ndlen); |
1057 |
if (_pcre_ucp_findprop(nd, &chartype, &script) != ucp_M) break; |
if (UCD_CATEGORY(nd) != ucp_M) break; |
1058 |
ncount++; |
ncount++; |
1059 |
nptr += ndlen; |
nptr += ndlen; |
1060 |
} |
} |
1213 |
if (clen > 0) |
if (clen > 0) |
1214 |
{ |
{ |
1215 |
BOOL OK; |
BOOL OK; |
1216 |
int category = _pcre_ucp_findprop(c, &chartype, &script); |
const ucd_record * prop = GET_UCD(c); |
1217 |
switch(code[2]) |
switch(code[2]) |
1218 |
{ |
{ |
1219 |
case PT_ANY: |
case PT_ANY: |
1221 |
break; |
break; |
1222 |
|
|
1223 |
case PT_LAMP: |
case PT_LAMP: |
1224 |
OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt; |
OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt; |
1225 |
break; |
break; |
1226 |
|
|
1227 |
case PT_GC: |
case PT_GC: |
1228 |
OK = category == code[3]; |
OK = ucp_gentype[prop->chartype] == code[3]; |
1229 |
break; |
break; |
1230 |
|
|
1231 |
case PT_PC: |
case PT_PC: |
1232 |
OK = chartype == code[3]; |
OK = prop->chartype == code[3]; |
1233 |
break; |
break; |
1234 |
|
|
1235 |
case PT_SC: |
case PT_SC: |
1236 |
OK = script == code[3]; |
OK = prop->script == code[3]; |
1237 |
break; |
break; |
1238 |
|
|
1239 |
/* Should never occur, but keep compilers from grumbling. */ |
/* Should never occur, but keep compilers from grumbling. */ |
1271 |
QS2: |
QS2: |
1272 |
|
|
1273 |
ADD_ACTIVE(state_offset + 2, 0); |
ADD_ACTIVE(state_offset + 2, 0); |
1274 |
if (clen > 0 && _pcre_ucp_findprop(c, &chartype, &script) != ucp_M) |
if (clen > 0 && UCD_CATEGORY(c) != ucp_M) |
1275 |
{ |
{ |
1276 |
const uschar *nptr = ptr + clen; |
const uschar *nptr = ptr + clen; |
1277 |
int ncount = 0; |
int ncount = 0; |
1286 |
int nd; |
int nd; |
1287 |
int ndlen = 1; |
int ndlen = 1; |
1288 |
GETCHARLEN(nd, nptr, ndlen); |
GETCHARLEN(nd, nptr, ndlen); |
1289 |
if (_pcre_ucp_findprop(nd, &chartype, &script) != ucp_M) break; |
if (UCD_CATEGORY(nd) != ucp_M) break; |
1290 |
ncount++; |
ncount++; |
1291 |
nptr += ndlen; |
nptr += ndlen; |
1292 |
} |
} |
1460 |
if (clen > 0) |
if (clen > 0) |
1461 |
{ |
{ |
1462 |
BOOL OK; |
BOOL OK; |
1463 |
int category = _pcre_ucp_findprop(c, &chartype, &script); |
const ucd_record * prop = GET_UCD(c); |
1464 |
switch(code[4]) |
switch(code[4]) |
1465 |
{ |
{ |
1466 |
case PT_ANY: |
case PT_ANY: |
1468 |
break; |
break; |
1469 |
|
|
1470 |
case PT_LAMP: |
case PT_LAMP: |
1471 |
OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt; |
OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt; |
1472 |
break; |
break; |
1473 |
|
|
1474 |
case PT_GC: |
case PT_GC: |
1475 |
OK = category == code[5]; |
OK = ucp_gentype[prop->chartype] == code[5]; |
1476 |
break; |
break; |
1477 |
|
|
1478 |
case PT_PC: |
case PT_PC: |
1479 |
OK = chartype == code[5]; |
OK = prop->chartype == code[5]; |
1480 |
break; |
break; |
1481 |
|
|
1482 |
case PT_SC: |
case PT_SC: |
1483 |
OK = script == code[5]; |
OK = prop->script == code[5]; |
1484 |
break; |
break; |
1485 |
|
|
1486 |
/* Should never occur, but keep compilers from grumbling. */ |
/* Should never occur, but keep compilers from grumbling. */ |
1513 |
if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT) |
if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT) |
1514 |
{ ADD_ACTIVE(state_offset + 4, 0); } |
{ ADD_ACTIVE(state_offset + 4, 0); } |
1515 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
1516 |
if (clen > 0 && _pcre_ucp_findprop(c, &chartype, &script) != ucp_M) |
if (clen > 0 && UCD_CATEGORY(c) != ucp_M) |
1517 |
{ |
{ |
1518 |
const uschar *nptr = ptr + clen; |
const uschar *nptr = ptr + clen; |
1519 |
int ncount = 0; |
int ncount = 0; |
1527 |
int nd; |
int nd; |
1528 |
int ndlen = 1; |
int ndlen = 1; |
1529 |
GETCHARLEN(nd, nptr, ndlen); |
GETCHARLEN(nd, nptr, ndlen); |
1530 |
if (_pcre_ucp_findprop(nd, &chartype, &script) != ucp_M) break; |
if (UCD_CATEGORY(nd) != ucp_M) break; |
1531 |
ncount++; |
ncount++; |
1532 |
nptr += ndlen; |
nptr += ndlen; |
1533 |
} |
} |
1707 |
other case of the character. */ |
other case of the character. */ |
1708 |
|
|
1709 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1710 |
othercase = _pcre_ucp_othercase(c); |
othercase = UCD_OTHERCASE(c); |
1711 |
#else |
#else |
1712 |
othercase = NOTACHAR; |
othercase = NOTACHAR; |
1713 |
#endif |
#endif |
1732 |
to wait for them to pass before continuing. */ |
to wait for them to pass before continuing. */ |
1733 |
|
|
1734 |
case OP_EXTUNI: |
case OP_EXTUNI: |
1735 |
if (clen > 0 && _pcre_ucp_findprop(c, &chartype, &script) != ucp_M) |
if (clen > 0 && UCD_CATEGORY(c) != ucp_M) |
1736 |
{ |
{ |
1737 |
const uschar *nptr = ptr + clen; |
const uschar *nptr = ptr + clen; |
1738 |
int ncount = 0; |
int ncount = 0; |
1740 |
{ |
{ |
1741 |
int nclen = 1; |
int nclen = 1; |
1742 |
GETCHARLEN(c, nptr, nclen); |
GETCHARLEN(c, nptr, nclen); |
1743 |
if (_pcre_ucp_findprop(c, &chartype, &script) != ucp_M) break; |
if (UCD_CATEGORY(c) != ucp_M) break; |
1744 |
ncount++; |
ncount++; |
1745 |
nptr += nclen; |
nptr += nclen; |
1746 |
} |
} |
1908 |
if (utf8 && d >= 128) |
if (utf8 && d >= 128) |
1909 |
{ |
{ |
1910 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1911 |
otherd = _pcre_ucp_othercase(d); |
otherd = UCD_OTHERCASE(d); |
1912 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
1913 |
} |
} |
1914 |
else |
else |
1946 |
if (utf8 && d >= 128) |
if (utf8 && d >= 128) |
1947 |
{ |
{ |
1948 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1949 |
otherd = _pcre_ucp_othercase(d); |
otherd = UCD_OTHERCASE(d); |
1950 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
1951 |
} |
} |
1952 |
else |
else |
1982 |
if (utf8 && d >= 128) |
if (utf8 && d >= 128) |
1983 |
{ |
{ |
1984 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1985 |
otherd = _pcre_ucp_othercase(d); |
otherd = UCD_OTHERCASE(d); |
1986 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
1987 |
} |
} |
1988 |
else |
else |
2014 |
if (utf8 && d >= 128) |
if (utf8 && d >= 128) |
2015 |
{ |
{ |
2016 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
2017 |
otherd = _pcre_ucp_othercase(d); |
otherd = UCD_OTHERCASE(d); |
2018 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
2019 |
} |
} |
2020 |
else |
else |
2049 |
if (utf8 && d >= 128) |
if (utf8 && d >= 128) |
2050 |
{ |
{ |
2051 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
2052 |
otherd = _pcre_ucp_othercase(d); |
otherd = UCD_OTHERCASE(d); |
2053 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
2054 |
} |
} |
2055 |
else |
else |