/** * Registers standard variants with the system. Called by * Transliterator during initialization.
*/ void UnescapeTransliterator::registerIDs() {
Token t = integerToken(0);
while (start < limit) { // Loop over the forms in spec[]. Exit this loop when we // match one of the specs. Exit the outer loop if a // partial match is detected and isIncremental is true. for (ipat=0; spec[ipat] != END;) {
// s is a copy of start that is advanced over the // characters as we parse them.
int32_t s = start;
UBool match = true;
for (i=0; i<prefixLen; ++i) { if (s >= limit) { if (i > 0) { // We've already matched a character. This is // a partial match, so we return if in // incremental mode. In non-incremental mode, // go to the next spec. if (isIncremental) { gotoexit;
}
match = false; break;
}
}
char16_t c = text.charAt(s++); if (c != spec[ipat + i]) {
match = false; break;
}
}
if (match) {
UChar32 u = 0;
int32_t digitCount = 0; for (;;) { if (s >= limit) { // Check for partial match in incremental mode. if (s > start && isIncremental) { gotoexit;
} break;
}
UChar32 ch = text.char32At(s);
int32_t digit = u_digit(ch, radix); if (digit < 0) { break;
}
s += U16_LENGTH(ch);
u = (u * radix) + digit; if (++digitCount == maxDigits) { break;
}
}
match = (digitCount >= minDigits);
if (match) { for (i=0; i<suffixLen; ++i) { if (s >= limit) { // Check for partial match in incremental mode. if (s > start && isIncremental) { gotoexit;
}
match = false; break;
}
char16_t c = text.charAt(s++); if (c != spec[ipat + prefixLen + i]) {
match = false; break;
}
}
if (match) { // At this point, we have a match
UnicodeString str(u);
text.handleReplaceBetween(start, s, str);
limit -= s - start - str.length(); // The following break statement leaves the // loop that is traversing the forms in // spec[]. We then parse the next input // character. break;
}
}
}
ipat += prefixLen + suffixLen;
}
if (start < limit) {
start += U16_LENGTH(text.char32At(start));
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.