Lines Matching refs:pattern
38 static void syntaxError(const UnicodeString& pattern,
48 pattern.extract(start,stop-start,parseError.preContext,0);
54 stop = ((pos+U_PARSE_CONTEXT_LEN)<=pattern.length()) ? (pos+(U_PARSE_CONTEXT_LEN-1)) :
55 pattern.length();
56 pattern.extract(start,stop-start,parseError.postContext,0);
137 const UnicodeString& pattern,
158 int32_t patLen = pattern.length();
159 // Part 0 is the positive pattern. Part 1, if present, is the negative
160 // pattern.
162 // The subpart ranges from 0 to 4: 0=pattern proper, 1=prefix,
164 // between the prefix and suffix, and consists of pattern
198 ch = pattern.char32At(pos);
200 case 0: // Pattern proper subpart (between prefix & suffix)
203 // to occur in the pattern ####00.00####, and we record the
210 if (pattern.compare(pos, digitLen, fDigit) == 0) {
226 syntaxError(pattern,pos,parseError);
244 } else if (pattern.compare(pos, groupSepLen, fGroupingSeparator) == 0) {
249 syntaxError(pattern,pos,parseError);
255 } else if (pattern.compare(pos, decimalSepLen, fDecimalSeparator) == 0) {
260 syntaxError(pattern,pos,parseError);
265 // at this point. We check pattern syntax below.
269 if (pattern.compare(pos, fExponent.length(), fExponent) == 0) {
274 syntaxError(pattern,pos,parseError);
278 // Grouping separator in exponential pattern
279 debug("Grouping separator in exponential pattern")
281 syntaxError(pattern,pos,parseError);
287 && pattern.compare(pos, fPlus.length(), fPlus) == 0) {
292 // pattern, then jump into suffix subpart.
295 pattern.char32At(pos) == fZeroDigit) {
300 // 1. Require at least one mantissa pattern digit
302 // 3. Require at least one exponent pattern digit
307 // Malformed exponential pattern
308 debug("Malformed exponential pattern")
310 syntaxError(pattern,pos,parseError);
330 if (!pattern.compare(pos, digitLen, fDigit) ||
331 !pattern.compare(pos, groupSepLen, fGroupingSeparator) ||
332 !pattern.compare(pos, decimalSepLen, fDecimalSeparator) ||
336 subpart = 0; // pattern proper subpart
341 syntaxError(pattern,pos,parseError);
349 if ((pos+1) < pattern.length() && pattern[pos+1] == kCurrencySign) {
352 if ((pos+1) < pattern.length() &&
353 pattern[pos+1] == kCurrencySign) {
370 pattern.length() && pattern[pos] == kQuote) {
377 } else if (pattern.compare(pos, fSeparator.length(), fSeparator) == 0) {
379 // separators in the second pattern (part == 1).
384 syntaxError(pattern,pos,parseError);
391 } else if (pattern.compare(pos, fPercent.length(), fPercent) == 0) {
397 syntaxError(pattern,pos,parseError);
401 affix->append(kPatternPercent); // Use unlocalized pattern char
405 } else if (pattern.compare(pos, fPerMill.length(), fPerMill) == 0) {
411 syntaxError(pattern,pos,parseError);
415 affix->append(kPatternPerMill); // Use unlocalized pattern char
419 } else if (pattern.compare(pos, fPadEscape.length(), fPadEscape) == 0) {
421 (pos+1) == pattern.length()) { // Nothing after padEscape
424 syntaxError(pattern,pos,parseError);
429 padChar = pattern.char32At(pos);
432 } else if (pattern.compare(pos, fMinus.length(), fMinus) == 0) {
437 } else if (pattern.compare(pos, fPlus.length(), fPlus) == 0) {
456 if (pos < pattern.length() && pattern[pos] == kQuote) {
471 sub0Limit = pattern.length();
475 sub2Limit = pattern.length();
478 /* Handle patterns with no '0' pattern character. These patterns
514 syntaxError(pattern,pos,parseError);
532 syntaxError(pattern,pos,parseError);
605 if (pattern.length() == 0) {
629 // If there was no negative pattern, or if the negative pattern is
630 // identical to the positive pattern, then prepend the minus sign to the
631 // positive pattern to form the negative pattern.