OLD | NEW |
1 /* | 1 /* |
2 ************************************************************************** | 2 ************************************************************************** |
3 * Copyright (C) 2002-2010 International Business Machines Corporation * | 3 * Copyright (C) 2002-2010 International Business Machines Corporation * |
4 * and others. All rights reserved. * | 4 * and others. All rights reserved. * |
5 ************************************************************************** | 5 ************************************************************************** |
6 */ | 6 */ |
7 // | 7 // |
8 // file: rematch.cpp | 8 // file: rematch.cpp |
9 // | 9 // |
10 // Contains the implementation of class RegexMatcher, | 10 // Contains the implementation of class RegexMatcher, |
(...skipping 5610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5621 if(foldLength >= 0) { | 5621 if(foldLength >= 0) { |
5622 if(foldLength <= UCASE_MAX_STRING_LENGTH) {
// !!!: Does not correctly handle chars that fold to 0-length strings | 5622 if(foldLength <= UCASE_MAX_STRING_LENGTH) {
// !!!: Does not correctly handle chars that fold to 0-length strings |
5623 foldOffset = 0; | 5623 foldOffset = 0; |
5624 U16_NEXT_UNSAFE(foldChars, foldOffset, c
); | 5624 U16_NEXT_UNSAFE(foldChars, foldOffset, c
); |
5625 } else { | 5625 } else { |
5626 c = foldLength; | 5626 c = foldLength; |
5627 foldLength = foldOffset; // to avoid rea
ding chars from the folding buffer | 5627 foldLength = foldOffset; // to avoid rea
ding chars from the folding buffer |
5628 } | 5628 } |
5629 } | 5629 } |
5630 } | 5630 } |
| 5631 } else { |
| 5632 c_is_valid = FALSE; |
5631 } | 5633 } |
5632 | 5634 |
5633 if (fp->fInputIdx <= fActiveLimit && c_is_valid) { | 5635 if (fp->fInputIdx <= fActiveLimit && c_is_valid) { |
5634 if (U_IS_BMP(c)) { | 5636 if (U_IS_BMP(c)) { |
5635 success = (*patternChars == c); | 5637 success = (*patternChars == c); |
5636 patternChars += 1; | 5638 patternChars += 1; |
5637 } else if (patternChars+1 < patternEnd) { | 5639 } else if (patternChars+1 < patternEnd) { |
5638 success = (*patternChars == U16_LEAD(c) && *(pat
ternChars+1) == U16_TRAIL(c)); | 5640 success = (*patternChars == U16_LEAD(c) && *(pat
ternChars+1) == U16_TRAIL(c)); |
5639 patternChars += 2; | 5641 patternChars += 2; |
5640 } | 5642 } |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6070 | 6072 |
6071 return; | 6073 return; |
6072 } | 6074 } |
6073 | 6075 |
6074 | 6076 |
6075 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RegexMatcher) | 6077 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RegexMatcher) |
6076 | 6078 |
6077 U_NAMESPACE_END | 6079 U_NAMESPACE_END |
6078 | 6080 |
6079 #endif // !UCONFIG_NO_REGULAR_EXPRESSIONS | 6081 #endif // !UCONFIG_NO_REGULAR_EXPRESSIONS |
OLD | NEW |