Changeset 28156 in webkit for trunk/JavaScriptCore/pcre/pcre_exec.cpp
- Timestamp:
- Nov 29, 2007, 3:19:42 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/pcre/pcre_exec.cpp
r28149 r28156 123 123 int offset_end; /* One past the end */ 124 124 int offset_max; /* The maximum usable for return data */ 125 const uschar* l cc;/* Points to lower casing table */125 const uschar* lowerCaseChars; /* Points to lower casing table */ 126 126 const uschar* ctypes; /* Points to table of type maps */ 127 127 bool offset_overflow; /* Set if too many extractions */ … … 131 131 int end_offset_top; /* Highwater mark at end of match */ 132 132 bool multiline; 133 bool caseless;133 bool ignoreCase; 134 134 }; 135 135 … … 223 223 /* Separate the caselesss case for speed */ 224 224 225 if (md. caseless) {225 if (md.ignoreCase) { 226 226 while (length-- > 0) { 227 227 UChar c = *p++; … … 1308 1308 1309 1309 if (stack.currentFrame->fc <= 0xFFFF) { 1310 int othercase = md. caseless? _pcre_ucp_othercase(stack.currentFrame->fc) : -1;1310 int othercase = md.ignoreCase ? _pcre_ucp_othercase(stack.currentFrame->fc) : -1; 1311 1311 1312 1312 for (i = 1; i <= min; i++) { … … 1409 1409 stack.currentFrame->ecode++; 1410 1410 GETCHARINCTEST(c, stack.currentFrame->eptr); 1411 if (md. caseless) {1411 if (md.ignoreCase) { 1412 1412 if (c < 128) 1413 c = md.l cc[c];1414 if (md.l cc[*stack.currentFrame->ecode++] == c)1413 c = md.lowerCaseChars[c]; 1414 if (md.lowerCaseChars[*stack.currentFrame->ecode++] == c) 1415 1415 RRETURN_NO_MATCH; 1416 1416 } else { … … 1472 1472 DPRINTF(("negative matching %c{%d,%d}\n", stack.currentFrame->fc, min, stack.currentFrame->max)); 1473 1473 1474 if (md. caseless) {1474 if (md.ignoreCase) { 1475 1475 if (stack.currentFrame->fc < 128) 1476 stack.currentFrame->fc = md.l cc[stack.currentFrame->fc];1476 stack.currentFrame->fc = md.lowerCaseChars[stack.currentFrame->fc]; 1477 1477 1478 1478 { … … 1481 1481 GETCHARINC(d, stack.currentFrame->eptr); 1482 1482 if (d < 128) 1483 d = md.l cc[d];1483 d = md.lowerCaseChars[d]; 1484 1484 if (stack.currentFrame->fc == d) 1485 1485 RRETURN_NO_MATCH; … … 1498 1498 GETCHARINC(d, stack.currentFrame->eptr); 1499 1499 if (d < 128) 1500 d = md.l cc[d];1500 d = md.lowerCaseChars[d]; 1501 1501 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame->eptr >= md.end_subject || stack.currentFrame->fc == d) 1502 1502 RRETURN; … … 1518 1518 GETCHARLEN(d, stack.currentFrame->eptr, len); 1519 1519 if (d < 128) 1520 d = md.l cc[d];1520 d = md.lowerCaseChars[d]; 1521 1521 if (stack.currentFrame->fc == d) 1522 1522 break; … … 2077 2077 UChar* end_subject = match_block.end_subject; 2078 2078 2079 match_block.l cc= _pcre_default_tables + lcc_offset;2079 match_block.lowerCaseChars = _pcre_default_tables + lcc_offset; 2080 2080 match_block.ctypes = _pcre_default_tables + ctypes_offset; 2081 2081 2082 2082 match_block.multiline = (re->options & PCRE_MULTILINE); 2083 match_block. caseless = (re->options & PCRE_CASELESS);2083 match_block.ignoreCase = (re->options & OptionIgnoreCase); 2084 2084 2085 2085 /* If the expression has got more back references than the offsets supplied can … … 2133 2133 if (re->options & PCRE_FIRSTSET) { 2134 2134 first_byte = re->first_byte & 255; 2135 if ((first_byte_caseless = (re->first_byte & REQ_ CASELESS)))2136 first_byte = match_block.l cc[first_byte];2135 if ((first_byte_caseless = (re->first_byte & REQ_IGNORE_CASE))) 2136 first_byte = match_block.lowerCaseChars[first_byte]; 2137 2137 } 2138 2138 … … 2145 2145 if (re->options & PCRE_REQCHSET) { 2146 2146 req_byte = re->req_byte & 255; 2147 req_byte_caseless = (re->req_byte & REQ_ CASELESS) != 0;2147 req_byte_caseless = (re->req_byte & REQ_IGNORE_CASE); 2148 2148 req_byte2 = (_pcre_default_tables + fcc_offset)[req_byte]; /* case flipped */ 2149 2149 } … … 2183 2183 if (sm > 127) 2184 2184 break; 2185 if (match_block.l cc[sm] == first_char)2185 if (match_block.lowerCaseChars[sm] == first_char) 2186 2186 break; 2187 2187 start_match++;
Note:
See TracChangeset
for help on using the changeset viewer.