• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/ICU-531.30/icuSources/i18n/

Lines Matching defs:pattern

51 static void syntaxError(const UnicodeString& pattern,
61 pattern.extract(start,stop-start,parseError.preContext,0);
67 stop = ((pos+U_PARSE_CONTEXT_LEN)<=pattern.length()) ? (pos+(U_PARSE_CONTEXT_LEN-1)) :
68 pattern.length();
69 pattern.extract(start,stop-start,parseError.postContext,0);
150 const UnicodeString& pattern,
171 int32_t patLen = pattern.length();
172 // Part 0 is the positive pattern. Part 1, if present, is the negative
173 // pattern.
175 // The subpart ranges from 0 to 4: 0=pattern proper, 1=prefix,
177 // between the prefix and suffix, and consists of pattern
211 ch = pattern.char32At(pos);
216 // to occur in the pattern ####00.00####, and we record the
223 if (pattern.compare(pos, digitLen, fDigit) == 0) {
239 syntaxError(pattern,pos,parseError);
257 } else if (pattern.compare(pos, groupSepLen, fGroupingSeparator) == 0) {
262 syntaxError(pattern,pos,parseError);
268 } else if (pattern.compare(pos, decimalSepLen, fDecimalSeparator) == 0) {
273 syntaxError(pattern,pos,parseError);
278 // at this point. We check pattern syntax below.
282 if (pattern.compare(pos, fExponent.length(), fExponent) == 0) {
287 syntaxError(pattern,pos,parseError);
291 // Grouping separator in exponential pattern
292 debug("Grouping separator in exponential pattern")
294 syntaxError(pattern,pos,parseError);
300 && pattern.compare(pos, fPlus.length(), fPlus) == 0) {
305 // pattern, then jump into suffix subpart.
308 pattern.char32At(pos) == fZeroDigit) {
313 // 1. Require at least one mantissa pattern digit
315 // 3. Require at least one exponent pattern digit
320 // Malformed exponential pattern
321 debug("Malformed exponential pattern")
323 syntaxError(pattern,pos,parseError);
343 if (!pattern.compare(pos, digitLen, fDigit) ||
344 !pattern.compare(pos, groupSepLen, fGroupingSeparator) ||
345 !pattern.compare(pos, decimalSepLen, fDecimalSeparator) ||
349 subpart = 0; // pattern proper subpart
354 syntaxError(pattern,pos,parseError);
362 if ((pos+1) < pattern.length() && pattern[pos+1] == kCurrencySign) {
365 if ((pos+1) < pattern.length() &&
366 pattern[pos+1] == kCurrencySign) {
383 if (pos < pattern.length() && pattern[pos] == kQuote) {
390 } else if (pattern.compare(pos, fSeparator.length(), fSeparator) == 0) {
392 // separators in the second pattern (part == 1).
397 syntaxError(pattern,pos,parseError);
404 } else if (pattern.compare(pos, fPercent.length(), fPercent) == 0) {
410 syntaxError(pattern,pos,parseError);
414 affix->append(kPatternPercent); // Use unlocalized pattern char
418 } else if (pattern.compare(pos, fPerMill.length(), fPerMill) == 0) {
424 syntaxError(pattern,pos,parseError);
428 affix->append(kPatternPerMill); // Use unlocalized pattern char
432 } else if (pattern.compare(pos, fPadEscape.length(), fPadEscape) == 0) {
434 (pos+1) == pattern.length()) { // Nothing after padEscape
437 syntaxError(pattern,pos,parseError);
442 padChar = pattern.char32At(pos);
445 } else if (pattern.compare(pos, fMinus.length(), fMinus) == 0) {
450 } else if (pattern.compare(pos, fPlus.length(), fPlus) == 0) {
469 if (pos < pattern.length() && pattern[pos] == kQuote) {
484 sub0Limit = pattern.length();
488 sub2Limit = pattern.length();
491 /* Handle patterns with no '0' pattern character. These patterns
527 syntaxError(pattern,pos,parseError);
545 syntaxError(pattern,pos,parseError);
618 if (pattern.length() == 0) {
642 // If there was no negative pattern, or if the negative pattern is
643 // identical to the positive pattern, then prepend the minus sign to the
644 // positive pattern to form the negative pattern.