Home | History | Annotate | Download | only in i18n

Lines Matching refs:errorCode

56 CollationRuleParser::CollationRuleParser(const CollationData *base, UErrorCode &errorCode)
57 : nfd(*Normalizer2::getNFDInstance(errorCode)),
58 nfc(*Normalizer2::getNFCInstance(errorCode)),
72 UErrorCode &errorCode) {
73 if(U_FAILURE(errorCode)) { return; }
83 parse(ruleString, errorCode);
87 CollationRuleParser::parse(const UnicodeString &ruleString, UErrorCode &errorCode) {
88 if(U_FAILURE(errorCode)) { return; }
100 parseRuleChain(errorCode);
103 parseSetting(errorCode);
110 UCOL_ON, 0, errorCode);
119 setParseError("expected a reset or setting or comment", errorCode);
122 if(U_FAILURE(errorCode)) { return; }
127 CollationRuleParser::parseRuleChain(UErrorCode &errorCode) {
128 int32_t resetStrength = parseResetAndPosition(errorCode);
131 int32_t result = parseRelationOperator(errorCode);
132 if(U_FAILURE(errorCode)) { return; }
140 setParseError("reset not followed by a relation", errorCode);
149 setParseError("reset-before strength differs from its first relation", errorCode);
154 setParseError("reset-before strength followed by a stronger relation", errorCode);
161 parseRelationStrings(strength, i, errorCode);
163 parseStarredCharacters(strength, i, errorCode);
165 if(U_FAILURE(errorCode)) { return; }
171 CollationRuleParser::parseResetAndPosition(UErrorCode &errorCode) {
172 if(U_FAILURE(errorCode)) { return UCOL_DEFAULT; }
190 setParseError("reset without position", errorCode);
195 i = parseSpecialPosition(i, str, errorCode);
197 i = parseTailoringString(i, str, errorCode);
199 sink->addReset(resetStrength, str, errorReason, errorCode);
200 if(U_FAILURE(errorCode)) { setErrorContext(); }
206 CollationRuleParser::parseRelationOperator(UErrorCode &errorCode) {
207 if(U_FAILURE(errorCode)) { return UCOL_DEFAULT; }
256 CollationRuleParser::parseRelationStrings(int32_t strength, int32_t i, UErrorCode &errorCode) {
261 i = parseTailoringString(i, str, errorCode);
262 if(U_FAILURE(errorCode)) { return; }
266 i = parseTailoringString(i + 1, str, errorCode);
267 if(U_FAILURE(errorCode)) { return; }
271 i = parseTailoringString(i + 1, extension, errorCode);
278 errorCode);
282 sink->addRelation(strength, prefix, str, extension, errorReason, errorCode);
283 if(U_FAILURE(errorCode)) { setErrorContext(); }
288 CollationRuleParser::parseStarredCharacters(int32_t strength, int32_t i, UErrorCode &errorCode) {
290 i = parseString(skipWhiteSpace(i), raw, errorCode);
291 if(U_FAILURE(errorCode)) { return; }
293 setParseError("missing starred-relation string", errorCode);
302 setParseError("starred-relation string is not all NFD-inert", errorCode);
305 sink->addRelation(strength, empty, UnicodeString(c), empty, errorReason, errorCode);
306 if(U_FAILURE(errorCode)) {
317 setParseError("range without start in starred-relation string", errorCode);
320 i = parseString(i + 1, raw, errorCode);
321 if(U_FAILURE(errorCode)) { return; }
323 setParseError("range without end in starred-relation string", errorCode);
328 setParseError("range start greater than end in starred-relation string", errorCode);
335 setParseError("starred-relation string range is not all NFD-inert", errorCode);
339 setParseError("starred-relation string range contains a surrogate", errorCode);
343 setParseError("starred-relation string range contains U+FFFD, U+FFFE or U+FFFF", errorCode);
347 sink->addRelation(strength, empty, s, empty, errorReason, errorCode);
348 if(U_FAILURE(errorCode)) {
360 CollationRuleParser::parseTailoringString(int32_t i, UnicodeString &raw, UErrorCode &errorCode) {
361 i = parseString(skipWhiteSpace(i), raw, errorCode);
362 if(U_SUCCESS(errorCode) && raw.isEmpty()) {
363 setParseError("missing relation string", errorCode);
369 CollationRuleParser::parseString(int32_t i, UnicodeString &raw, UErrorCode &errorCode) {
370 if(U_FAILURE(errorCode)) { return i; }
385 setParseError("quoted literal text missing terminating apostrophe", errorCode);
402 setParseError("backslash escape at the end of the rule string", errorCode);
424 setParseError("string contains an unpaired surrogate", errorCode);
428 setParseError("string contains U+FFFD, U+FFFE or U+FFFF", errorCode);
458 CollationRuleParser::parseSpecialPosition(int32_t i, UnicodeString &str, UErrorCode &errorCode) {
459 if(U_FAILURE(errorCode)) { return 0; }
479 setParseError("not a valid special reset position", errorCode);
484 CollationRuleParser::parseSetting(UErrorCode &errorCode) {
485 errorCode)) { return; }
490 setParseError("expected a setting/option at '['", errorCode);
496 parseReordering(raw, errorCode);
502 UCOL_ON, 0, errorCode);
521 settings->setStrength(value, 0, errorCode);
533 settings->setAlternateHandling(value, 0, errorCode);
549 settings->setMaxVariable(value, 0, errorCode);
566 settings->setCaseFirst(value, 0, errorCode);
573 settings->setFlag(CollationSettings::CASE_LEVEL, value, 0, errorCode);
580 settings->setFlag(CollationSettings::CHECK_FCD, value, 0, errorCode);
587 settings->setFlag(CollationSettings::NUMERIC, value, 0, errorCode);
595 setParseError("[hiraganaQ on] is not supported", errorCode);
602 lang.appendInvariantChars(v, errorCode);
603 if(errorCode == U_MEMORY_ALLOCATION_ERROR) { return; }
608 &parsedLength, &errorCode);
609 if(U_FAILURE(errorCode) ||
611 errorCode = U_ZERO_ERROR;
612 setParseError("expected language tag in [import langTag]", errorCode);
617 length = uloc_getBaseName(localeID, baseID, ULOC_FULLNAME_CAPACITY, &errorCode);
618 if(U_FAILURE(errorCode) || length >= ULOC_KEYWORDS_CAPACITY) {
619 errorCode = U_ZERO_ERROR;
620 setParseError("expected language tag in [import langTag]", errorCode);
630 &errorCode);
631 if(U_FAILURE(errorCode) || length >= ULOC_KEYWORDS_CAPACITY) {
632 errorCode = U_ZERO_ERROR;
633 setParseError("expected language tag in [import langTag]", errorCode);
637 setParseError("[import langTag] is not supported", errorCode);
641 importedRules, errorReason, errorCode);
642 if(U_FAILURE(errorCode)) {
651 parse(importedRules, errorCode);
652 if(U_FAILURE(errorCode)) {
664 j = parseUnicodeSet(j, set, errorCode);
665 if(U_FAILURE(errorCode)) { return; }
667 sink->optimize(set, errorReason, errorCode);
668 if(U_FAILURE(errorCode)) { setErrorContext(); }
672 sink->suppressContractions(set, errorReason, errorCode);
673 if(U_FAILURE(errorCode)) { setErrorContext(); }
678 setParseError("not a valid setting/option", errorCode);
682 CollationRuleParser::parseReordering(const UnicodeString &raw, UErrorCode &errorCode) {
683 if(U_FAILURE(errorCode)) { return; }
691 UVector32 reorderCodes(errorCode);
692 if(U_FAILURE(errorCode)) { return; }
698 word.clear().appendInvariantChars(raw.tempSubStringBetween(i, limit), errorCode);
699 if(U_FAILURE(errorCode)) { return; }
702 setParseError("unknown script or reorder code", errorCode);
705 reorderCodes.addElement(code, errorCode);
706 if(U_FAILURE(errorCode)) { return; }
709 settings->setReordering(*baseData, reorderCodes.getBuffer(), reorderCodes.size(), errorCode);
745 CollationRuleParser::parseUnicodeSet(int32_t i, UnicodeSet &set, UErrorCode &errorCode) {
751 setParseError("unbalanced UnicodeSet pattern brackets", errorCode);
761 set.applyPattern(rules->tempSubStringBetween(i, j), errorCode);
762 if(U_FAILURE(errorCode)) {
763 errorCode = U_ZERO_ERROR;
764 setParseError("not a valid UnicodeSet pattern", errorCode);
769 setParseError("missing option-terminating ']' after UnicodeSet pattern", errorCode);
817 CollationRuleParser::setParseError(const char *reason, UErrorCode &errorCode) {
818 if(U_FAILURE(errorCode)) { return; }
821 errorCode = U_INVALID_FORMAT_ERROR;