Home | History | Annotate | Download | only in i18n

Lines Matching refs:errorCode

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