Lines Matching refs:errorCode
58 CollationRuleParser::CollationRuleParser(const CollationData *base, UErrorCode &errorCode) in CollationRuleParser() argument
59 : nfd(*Normalizer2::getNFDInstance(errorCode)), in CollationRuleParser()
60 nfc(*Normalizer2::getNFCInstance(errorCode)), in CollationRuleParser()
74 UErrorCode &errorCode) { in parse() argument
75 if(U_FAILURE(errorCode)) { return; } in parse()
85 parse(ruleString, errorCode); in parse()
89 CollationRuleParser::parse(const UnicodeString &ruleString, UErrorCode &errorCode) { in parse() argument
90 if(U_FAILURE(errorCode)) { return; } in parse()
102 parseRuleChain(errorCode); in parse()
105 parseSetting(errorCode); in parse()
112 UCOL_ON, 0, errorCode); in parse()
121 setParseError("expected a reset or setting or comment", errorCode); in parse()
124 if(U_FAILURE(errorCode)) { return; } in parse()
129 CollationRuleParser::parseRuleChain(UErrorCode &errorCode) { in parseRuleChain() argument
130 int32_t resetStrength = parseResetAndPosition(errorCode); in parseRuleChain()
133 int32_t result = parseRelationOperator(errorCode); in parseRuleChain()
134 if(U_FAILURE(errorCode)) { return; } in parseRuleChain()
142 setParseError("reset not followed by a relation", errorCode); in parseRuleChain()
151 … setParseError("reset-before strength differs from its first relation", errorCode); in parseRuleChain()
156 … setParseError("reset-before strength followed by a stronger relation", errorCode); in parseRuleChain()
163 parseRelationStrings(strength, i, errorCode); in parseRuleChain()
165 parseStarredCharacters(strength, i, errorCode); in parseRuleChain()
167 if(U_FAILURE(errorCode)) { return; } in parseRuleChain()
173 CollationRuleParser::parseResetAndPosition(UErrorCode &errorCode) { in parseResetAndPosition() argument
174 if(U_FAILURE(errorCode)) { return UCOL_DEFAULT; } in parseResetAndPosition()
192 setParseError("reset without position", errorCode); in parseResetAndPosition()
197 i = parseSpecialPosition(i, str, errorCode); in parseResetAndPosition()
199 i = parseTailoringString(i, str, errorCode); in parseResetAndPosition()
201 sink->addReset(resetStrength, str, errorReason, errorCode); in parseResetAndPosition()
202 if(U_FAILURE(errorCode)) { setErrorContext(); } in parseResetAndPosition()
208 CollationRuleParser::parseRelationOperator(UErrorCode &errorCode) { in parseRelationOperator() argument
209 if(U_FAILURE(errorCode)) { return UCOL_DEFAULT; } in parseRelationOperator()
258 CollationRuleParser::parseRelationStrings(int32_t strength, int32_t i, UErrorCode &errorCode) { in parseRelationStrings() argument
263 i = parseTailoringString(i, str, errorCode); in parseRelationStrings()
264 if(U_FAILURE(errorCode)) { return; } in parseRelationStrings()
268 i = parseTailoringString(i + 1, str, errorCode); in parseRelationStrings()
269 if(U_FAILURE(errorCode)) { return; } in parseRelationStrings()
273 i = parseTailoringString(i + 1, extension, errorCode); in parseRelationStrings()
280 errorCode); in parseRelationStrings()
284 sink->addRelation(strength, prefix, str, extension, errorReason, errorCode); in parseRelationStrings()
285 if(U_FAILURE(errorCode)) { setErrorContext(); } in parseRelationStrings()
290 CollationRuleParser::parseStarredCharacters(int32_t strength, int32_t i, UErrorCode &errorCode) { in parseStarredCharacters() argument
292 i = parseString(skipWhiteSpace(i), raw, errorCode); in parseStarredCharacters()
293 if(U_FAILURE(errorCode)) { return; } in parseStarredCharacters()
295 setParseError("missing starred-relation string", errorCode); in parseStarredCharacters()
304 setParseError("starred-relation string is not all NFD-inert", errorCode); in parseStarredCharacters()
307 sink->addRelation(strength, empty, UnicodeString(c), empty, errorReason, errorCode); in parseStarredCharacters()
308 if(U_FAILURE(errorCode)) { in parseStarredCharacters()
319 setParseError("range without start in starred-relation string", errorCode); in parseStarredCharacters()
322 i = parseString(i + 1, raw, errorCode); in parseStarredCharacters()
323 if(U_FAILURE(errorCode)) { return; } in parseStarredCharacters()
325 setParseError("range without end in starred-relation string", errorCode); in parseStarredCharacters()
330 setParseError("range start greater than end in starred-relation string", errorCode); in parseStarredCharacters()
337 setParseError("starred-relation string range is not all NFD-inert", errorCode); in parseStarredCharacters()
341 setParseError("starred-relation string range contains a surrogate", errorCode); in parseStarredCharacters()
345 … setParseError("starred-relation string range contains U+FFFD, U+FFFE or U+FFFF", errorCode); in parseStarredCharacters()
349 sink->addRelation(strength, empty, s, empty, errorReason, errorCode); in parseStarredCharacters()
350 if(U_FAILURE(errorCode)) { in parseStarredCharacters()
362 CollationRuleParser::parseTailoringString(int32_t i, UnicodeString &raw, UErrorCode &errorCode) { in parseTailoringString() argument
363 i = parseString(skipWhiteSpace(i), raw, errorCode); in parseTailoringString()
364 if(U_SUCCESS(errorCode) && raw.isEmpty()) { in parseTailoringString()
365 setParseError("missing relation string", errorCode); in parseTailoringString()
371 CollationRuleParser::parseString(int32_t i, UnicodeString &raw, UErrorCode &errorCode) { in parseString() argument
372 if(U_FAILURE(errorCode)) { return i; } in parseString()
387 … setParseError("quoted literal text missing terminating apostrophe", errorCode); in parseString()
404 setParseError("backslash escape at the end of the rule string", errorCode); in parseString()
426 setParseError("string contains an unpaired surrogate", errorCode); in parseString()
430 setParseError("string contains U+FFFD, U+FFFE or U+FFFF", errorCode); in parseString()
460 CollationRuleParser::parseSpecialPosition(int32_t i, UnicodeString &str, UErrorCode &errorCode) { in parseSpecialPosition() argument
461 if(U_FAILURE(errorCode)) { return 0; } in parseSpecialPosition()
481 setParseError("not a valid special reset position", errorCode); in parseSpecialPosition()
486 CollationRuleParser::parseSetting(UErrorCode &errorCode) { in parseSetting() argument
487 if(U_FAILURE(errorCode)) { return; } in parseSetting()
492 setParseError("expected a setting/option at '['", errorCode); in parseSetting()
498 parseReordering(raw, errorCode); in parseSetting()
504 UCOL_ON, 0, errorCode); in parseSetting()
523 settings->setStrength(value, 0, errorCode); in parseSetting()
535 settings->setAlternateHandling(value, 0, errorCode); in parseSetting()
551 settings->setMaxVariable(value, 0, errorCode); in parseSetting()
568 settings->setCaseFirst(value, 0, errorCode); in parseSetting()
575 settings->setFlag(CollationSettings::CASE_LEVEL, value, 0, errorCode); in parseSetting()
582 settings->setFlag(CollationSettings::CHECK_FCD, value, 0, errorCode); in parseSetting()
589 settings->setFlag(CollationSettings::NUMERIC, value, 0, errorCode); in parseSetting()
597 setParseError("[hiraganaQ on] is not supported", errorCode); in parseSetting()
604 lang.appendInvariantChars(v, errorCode); in parseSetting()
605 if(errorCode == U_MEMORY_ALLOCATION_ERROR) { return; } in parseSetting()
610 &parsedLength, &errorCode); in parseSetting()
611 if(U_FAILURE(errorCode) || in parseSetting()
613 errorCode = U_ZERO_ERROR; in parseSetting()
614 setParseError("expected language tag in [import langTag]", errorCode); in parseSetting()
619 length = uloc_getBaseName(localeID, baseID, ULOC_FULLNAME_CAPACITY, &errorCode); in parseSetting()
620 if(U_FAILURE(errorCode) || length >= ULOC_KEYWORDS_CAPACITY) { in parseSetting()
621 errorCode = U_ZERO_ERROR; in parseSetting()
622 setParseError("expected language tag in [import langTag]", errorCode); in parseSetting()
635 &errorCode); in parseSetting()
636 if(U_FAILURE(errorCode) || length >= ULOC_KEYWORDS_CAPACITY) { in parseSetting()
637 errorCode = U_ZERO_ERROR; in parseSetting()
638 setParseError("expected language tag in [import langTag]", errorCode); in parseSetting()
642 setParseError("[import langTag] is not supported", errorCode); in parseSetting()
646 importedRules, errorReason, errorCode); in parseSetting()
647 if(U_FAILURE(errorCode)) { in parseSetting()
656 parse(importedRules, errorCode); in parseSetting()
657 if(U_FAILURE(errorCode)) { in parseSetting()
669 j = parseUnicodeSet(j, set, errorCode); in parseSetting()
670 if(U_FAILURE(errorCode)) { return; } in parseSetting()
672 sink->optimize(set, errorReason, errorCode); in parseSetting()
673 if(U_FAILURE(errorCode)) { setErrorContext(); } in parseSetting()
677 sink->suppressContractions(set, errorReason, errorCode); in parseSetting()
678 if(U_FAILURE(errorCode)) { setErrorContext(); } in parseSetting()
683 setParseError("not a valid setting/option", errorCode); in parseSetting()
687 CollationRuleParser::parseReordering(const UnicodeString &raw, UErrorCode &errorCode) { in parseReordering() argument
688 if(U_FAILURE(errorCode)) { return; } in parseReordering()
696 UVector32 reorderCodes(errorCode); in parseReordering()
697 if(U_FAILURE(errorCode)) { return; } in parseReordering()
703 word.clear().appendInvariantChars(raw.tempSubStringBetween(i, limit), errorCode); in parseReordering()
704 if(U_FAILURE(errorCode)) { return; } in parseReordering()
707 setParseError("unknown script or reorder code", errorCode); in parseReordering()
710 reorderCodes.addElement(code, errorCode); in parseReordering()
711 if(U_FAILURE(errorCode)) { return; } in parseReordering()
714 settings->setReordering(*baseData, reorderCodes.getBuffer(), reorderCodes.size(), errorCode); in parseReordering()
750 CollationRuleParser::parseUnicodeSet(int32_t i, UnicodeSet &set, UErrorCode &errorCode) { in parseUnicodeSet() argument
756 setParseError("unbalanced UnicodeSet pattern brackets", errorCode); in parseUnicodeSet()
766 set.applyPattern(rules->tempSubStringBetween(i, j), errorCode); in parseUnicodeSet()
767 if(U_FAILURE(errorCode)) { in parseUnicodeSet()
768 errorCode = U_ZERO_ERROR; in parseUnicodeSet()
769 setParseError("not a valid UnicodeSet pattern", errorCode); in parseUnicodeSet()
774 setParseError("missing option-terminating ']' after UnicodeSet pattern", errorCode); in parseUnicodeSet()
822 CollationRuleParser::setParseError(const char *reason, UErrorCode &errorCode) { in setParseError() argument
823 if(U_FAILURE(errorCode)) { return; } in setParseError()
826 errorCode = U_INVALID_FORMAT_ERROR; in setParseError()