442 |
|
|
443 |
first_op = this_start_code + 1 + LINK_SIZE + |
first_op = this_start_code + 1 + LINK_SIZE + |
444 |
((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA || |
((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA || |
445 |
*this_start_code == OP_CBRAPOS || *this_start_code == OP_SCBRAPOS)? 2:0); |
*this_start_code == OP_CBRAPOS || *this_start_code == OP_SCBRAPOS) |
446 |
|
? IMM2_SIZE:0); |
447 |
|
|
448 |
/* The first thing in any (sub) pattern is a bracket of some sort. Push all |
/* The first thing in any (sub) pattern is a bracket of some sort. Push all |
449 |
the alternative states onto the list, and find out where the end is. This |
the alternative states onto the list, and find out where the end is. This |
543 |
{ |
{ |
544 |
int length = 1 + LINK_SIZE + |
int length = 1 + LINK_SIZE + |
545 |
((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA || |
((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA || |
546 |
*this_start_code == OP_CBRAPOS || *this_start_code == OP_SCBRAPOS)? |
*this_start_code == OP_CBRAPOS || *this_start_code == OP_SCBRAPOS) |
547 |
2:0); |
? IMM2_SIZE:0); |
548 |
do |
do |
549 |
{ |
{ |
550 |
ADD_NEW((int)(end_code - start_code + length), 0); |
ADD_NEW((int)(end_code - start_code + length), 0); |
557 |
|
|
558 |
workspace[0] = 0; /* Bit indicating which vector is current */ |
workspace[0] = 0; /* Bit indicating which vector is current */ |
559 |
|
|
560 |
DPRINTF(("%.*sEnd state = %d\n", rlevel*2-2, SP, end_code - start_code)); |
DPRINTF(("%.*sEnd state = %d\n", rlevel*2-2, SP, (int)(end_code - start_code))); |
561 |
|
|
562 |
/* Loop for scanning the subject */ |
/* Loop for scanning the subject */ |
563 |
|
|
817 |
/*-----------------------------------------------------------------*/ |
/*-----------------------------------------------------------------*/ |
818 |
case OP_CBRA: |
case OP_CBRA: |
819 |
case OP_SCBRA: |
case OP_SCBRA: |
820 |
ADD_ACTIVE((int)(code - start_code + 3 + LINK_SIZE), 0); |
ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE + IMM2_SIZE), 0); |
821 |
code += GET(code, 1); |
code += GET(code, 1); |
822 |
while (*code == OP_ALT) |
while (*code == OP_ALT) |
823 |
{ |
{ |
1158 |
((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) |
((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0)) |
1159 |
{ |
{ |
1160 |
if (++count >= GET2(code, 1)) |
if (++count >= GET2(code, 1)) |
1161 |
{ ADD_NEW(state_offset + 4, 0); } |
{ ADD_NEW(state_offset + 1 + IMM2_SIZE + 1, 0); } |
1162 |
else |
else |
1163 |
{ ADD_NEW(state_offset, count); } |
{ ADD_NEW(state_offset, count); } |
1164 |
} |
} |
1169 |
case OP_TYPEUPTO: |
case OP_TYPEUPTO: |
1170 |
case OP_TYPEMINUPTO: |
case OP_TYPEMINUPTO: |
1171 |
case OP_TYPEPOSUPTO: |
case OP_TYPEPOSUPTO: |
1172 |
ADD_ACTIVE(state_offset + 4, 0); |
ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0); |
1173 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
1174 |
if (clen > 0) |
if (clen > 0) |
1175 |
{ |
{ |
1184 |
next_active_state--; |
next_active_state--; |
1185 |
} |
} |
1186 |
if (++count >= GET2(code, 1)) |
if (++count >= GET2(code, 1)) |
1187 |
{ ADD_NEW(state_offset + 4, 0); } |
{ ADD_NEW(state_offset + 2 + IMM2_SIZE, 0); } |
1188 |
else |
else |
1189 |
{ ADD_NEW(state_offset, count); } |
{ ADD_NEW(state_offset, count); } |
1190 |
} |
} |
1720 |
case OP_PROP_EXTRA + OP_TYPEMINUPTO: |
case OP_PROP_EXTRA + OP_TYPEMINUPTO: |
1721 |
case OP_PROP_EXTRA + OP_TYPEPOSUPTO: |
case OP_PROP_EXTRA + OP_TYPEPOSUPTO: |
1722 |
if (codevalue != OP_PROP_EXTRA + OP_TYPEEXACT) |
if (codevalue != OP_PROP_EXTRA + OP_TYPEEXACT) |
1723 |
{ ADD_ACTIVE(state_offset + 6, 0); } |
{ ADD_ACTIVE(state_offset + 1 + IMM2_SIZE + 3, 0); } |
1724 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
1725 |
if (clen > 0) |
if (clen > 0) |
1726 |
{ |
{ |
1727 |
BOOL OK; |
BOOL OK; |
1728 |
const ucd_record * prop = GET_UCD(c); |
const ucd_record * prop = GET_UCD(c); |
1729 |
switch(code[4]) |
switch(code[1 + IMM2_SIZE + 1]) |
1730 |
{ |
{ |
1731 |
case PT_ANY: |
case PT_ANY: |
1732 |
OK = TRUE; |
OK = TRUE; |
1738 |
break; |
break; |
1739 |
|
|
1740 |
case PT_GC: |
case PT_GC: |
1741 |
OK = PRIV(ucp_gentype)[prop->chartype] == code[5]; |
OK = PRIV(ucp_gentype)[prop->chartype] == code[1 + IMM2_SIZE + 2]; |
1742 |
break; |
break; |
1743 |
|
|
1744 |
case PT_PC: |
case PT_PC: |
1745 |
OK = prop->chartype == code[5]; |
OK = prop->chartype == code[1 + IMM2_SIZE + 2]; |
1746 |
break; |
break; |
1747 |
|
|
1748 |
case PT_SC: |
case PT_SC: |
1749 |
OK = prop->script == code[5]; |
OK = prop->script == code[1 + IMM2_SIZE + 2]; |
1750 |
break; |
break; |
1751 |
|
|
1752 |
/* These are specials for combination cases. */ |
/* These are specials for combination cases. */ |
1788 |
next_active_state--; |
next_active_state--; |
1789 |
} |
} |
1790 |
if (++count >= GET2(code, 1)) |
if (++count >= GET2(code, 1)) |
1791 |
{ ADD_NEW(state_offset + 6, 0); } |
{ ADD_NEW(state_offset + 1 + IMM2_SIZE + 3, 0); } |
1792 |
else |
else |
1793 |
{ ADD_NEW(state_offset, count); } |
{ ADD_NEW(state_offset, count); } |
1794 |
} |
} |
1801 |
case OP_EXTUNI_EXTRA + OP_TYPEMINUPTO: |
case OP_EXTUNI_EXTRA + OP_TYPEMINUPTO: |
1802 |
case OP_EXTUNI_EXTRA + OP_TYPEPOSUPTO: |
case OP_EXTUNI_EXTRA + OP_TYPEPOSUPTO: |
1803 |
if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT) |
if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT) |
1804 |
{ ADD_ACTIVE(state_offset + 4, 0); } |
{ ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0); } |
1805 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
1806 |
if (clen > 0 && UCD_CATEGORY(c) != ucp_M) |
if (clen > 0 && UCD_CATEGORY(c) != ucp_M) |
1807 |
{ |
{ |
1822 |
nptr += ndlen; |
nptr += ndlen; |
1823 |
} |
} |
1824 |
if (++count >= GET2(code, 1)) |
if (++count >= GET2(code, 1)) |
1825 |
{ ADD_NEW_DATA(-(state_offset + 4), 0, ncount); } |
{ ADD_NEW_DATA(-(state_offset + 2 + IMM2_SIZE), 0, ncount); } |
1826 |
else |
else |
1827 |
{ ADD_NEW_DATA(-state_offset, count, ncount); } |
{ ADD_NEW_DATA(-state_offset, count, ncount); } |
1828 |
} |
} |
1835 |
case OP_ANYNL_EXTRA + OP_TYPEMINUPTO: |
case OP_ANYNL_EXTRA + OP_TYPEMINUPTO: |
1836 |
case OP_ANYNL_EXTRA + OP_TYPEPOSUPTO: |
case OP_ANYNL_EXTRA + OP_TYPEPOSUPTO: |
1837 |
if (codevalue != OP_ANYNL_EXTRA + OP_TYPEEXACT) |
if (codevalue != OP_ANYNL_EXTRA + OP_TYPEEXACT) |
1838 |
{ ADD_ACTIVE(state_offset + 4, 0); } |
{ ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0); } |
1839 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
1840 |
if (clen > 0) |
if (clen > 0) |
1841 |
{ |
{ |
1862 |
next_active_state--; |
next_active_state--; |
1863 |
} |
} |
1864 |
if (++count >= GET2(code, 1)) |
if (++count >= GET2(code, 1)) |
1865 |
{ ADD_NEW_DATA(-(state_offset + 4), 0, ncount); } |
{ ADD_NEW_DATA(-(state_offset + 2 + IMM2_SIZE), 0, ncount); } |
1866 |
else |
else |
1867 |
{ ADD_NEW_DATA(-state_offset, count, ncount); } |
{ ADD_NEW_DATA(-state_offset, count, ncount); } |
1868 |
break; |
break; |
1879 |
case OP_VSPACE_EXTRA + OP_TYPEMINUPTO: |
case OP_VSPACE_EXTRA + OP_TYPEMINUPTO: |
1880 |
case OP_VSPACE_EXTRA + OP_TYPEPOSUPTO: |
case OP_VSPACE_EXTRA + OP_TYPEPOSUPTO: |
1881 |
if (codevalue != OP_VSPACE_EXTRA + OP_TYPEEXACT) |
if (codevalue != OP_VSPACE_EXTRA + OP_TYPEEXACT) |
1882 |
{ ADD_ACTIVE(state_offset + 4, 0); } |
{ ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0); } |
1883 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
1884 |
if (clen > 0) |
if (clen > 0) |
1885 |
{ |
{ |
1908 |
next_active_state--; |
next_active_state--; |
1909 |
} |
} |
1910 |
if (++count >= GET2(code, 1)) |
if (++count >= GET2(code, 1)) |
1911 |
{ ADD_NEW_DATA(-(state_offset + 4), 0, 0); } |
{ ADD_NEW_DATA(-(state_offset + 2 + IMM2_SIZE), 0, 0); } |
1912 |
else |
else |
1913 |
{ ADD_NEW_DATA(-state_offset, count, 0); } |
{ ADD_NEW_DATA(-state_offset, count, 0); } |
1914 |
} |
} |
1921 |
case OP_HSPACE_EXTRA + OP_TYPEMINUPTO: |
case OP_HSPACE_EXTRA + OP_TYPEMINUPTO: |
1922 |
case OP_HSPACE_EXTRA + OP_TYPEPOSUPTO: |
case OP_HSPACE_EXTRA + OP_TYPEPOSUPTO: |
1923 |
if (codevalue != OP_HSPACE_EXTRA + OP_TYPEEXACT) |
if (codevalue != OP_HSPACE_EXTRA + OP_TYPEEXACT) |
1924 |
{ ADD_ACTIVE(state_offset + 4, 0); } |
{ ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0); } |
1925 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
1926 |
if (clen > 0) |
if (clen > 0) |
1927 |
{ |
{ |
1963 |
next_active_state--; |
next_active_state--; |
1964 |
} |
} |
1965 |
if (++count >= GET2(code, 1)) |
if (++count >= GET2(code, 1)) |
1966 |
{ ADD_NEW_DATA(-(state_offset + 4), 0, 0); } |
{ ADD_NEW_DATA(-(state_offset + 2 + IMM2_SIZE), 0, 0); } |
1967 |
else |
else |
1968 |
{ ADD_NEW_DATA(-state_offset, count, 0); } |
{ ADD_NEW_DATA(-state_offset, count, 0); } |
1969 |
} |
} |
2353 |
if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) |
if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR)) |
2354 |
{ |
{ |
2355 |
if (++count >= GET2(code, 1)) |
if (++count >= GET2(code, 1)) |
2356 |
{ ADD_NEW(state_offset + dlen + 3, 0); } |
{ ADD_NEW(state_offset + dlen + 1 + IMM2_SIZE, 0); } |
2357 |
else |
else |
2358 |
{ ADD_NEW(state_offset, count); } |
{ ADD_NEW(state_offset, count); } |
2359 |
} |
} |
2376 |
case OP_NOTUPTO: |
case OP_NOTUPTO: |
2377 |
case OP_NOTMINUPTO: |
case OP_NOTMINUPTO: |
2378 |
case OP_NOTPOSUPTO: |
case OP_NOTPOSUPTO: |
2379 |
ADD_ACTIVE(state_offset + dlen + 3, 0); |
ADD_ACTIVE(state_offset + dlen + 1 + IMM2_SIZE, 0); |
2380 |
count = current_state->count; /* Number already matched */ |
count = current_state->count; /* Number already matched */ |
2381 |
if (clen > 0) |
if (clen > 0) |
2382 |
{ |
{ |
2402 |
next_active_state--; |
next_active_state--; |
2403 |
} |
} |
2404 |
if (++count >= GET2(code, 1)) |
if (++count >= GET2(code, 1)) |
2405 |
{ ADD_NEW(state_offset + dlen + 3, 0); } |
{ ADD_NEW(state_offset + dlen + 1 + IMM2_SIZE, 0); } |
2406 |
else |
else |
2407 |
{ ADD_NEW(state_offset, count); } |
{ ADD_NEW(state_offset, count); } |
2408 |
} |
} |
2475 |
case OP_CRMINRANGE: |
case OP_CRMINRANGE: |
2476 |
count = current_state->count; /* Already matched */ |
count = current_state->count; /* Already matched */ |
2477 |
if (count >= GET2(ecode, 1)) |
if (count >= GET2(ecode, 1)) |
2478 |
{ ADD_ACTIVE(next_state_offset + 5, 0); } |
{ ADD_ACTIVE(next_state_offset + 1 + 2 * IMM2_SIZE, 0); } |
2479 |
if (isinclass) |
if (isinclass) |
2480 |
{ |
{ |
2481 |
int max = GET2(ecode, 3); |
int max = GET2(ecode, 3); |
2482 |
if (++count >= max && max != 0) /* Max 0 => no limit */ |
if (++count >= max && max != 0) /* Max 0 => no limit */ |
2483 |
{ ADD_NEW(next_state_offset + 5, 0); } |
{ ADD_NEW(next_state_offset + 1 + 2 * IMM2_SIZE, 0); } |
2484 |
else |
else |
2485 |
{ ADD_NEW(state_offset, count); } |
{ ADD_NEW(state_offset, count); } |
2486 |
} |
} |