ICU-96 case bit in tailorings

X-SVN-Rev: 3850
This commit is contained in:
Vladimir Weinstein 2001-03-01 00:14:29 +00:00
parent dbf2bfeadd
commit 04774b4970
3 changed files with 25 additions and 1 deletions

View File

@ -469,6 +469,11 @@ U_CFUNC void ucol_doCE(uint32_t *CEparts, UColToken *tok, UHashtable *tailored,
} else {
value = 0;
}
if(tok->caseBit == TRUE) {
value |= 0x40;
}
if(2*CEi<noOfBytes[0]) {
value |= ((CEparts[0]>>(32-16*(CEi+1))) & 0xFFFF) << 16;
}

View File

@ -1,11 +1,12 @@
#include "unicode/ustring.h"
#include "unicode/uchar.h"
#include "cmemory.h"
#include "ucoltok.h"
#include "uhash.h"
#include "ucmp32.h"
static UHashtable *uchars2tokens;
static UHashtable *uchars2tokens = 0;
static const UChar *rulesToParse = 0;
@ -119,6 +120,7 @@ uint32_t ucol_uprv_tok_assembleTokenList(UColTokenParser *src, UErrorCode *statu
uint32_t newCharsLen = 0, newExtensionsLen = 0;
uint32_t charsOffset = 0, extensionOffset = 0;
uint32_t expandNext = 0;
UBool caseBit = FALSE;
UColTokListHeader *ListList = NULL;
@ -150,6 +152,9 @@ uint32_t ucol_uprv_tok_assembleTokenList(UColTokenParser *src, UErrorCode *statu
charsOffset = src->current - src->source;
}
newCharsLen++;
if(u_tolower(ch)!=ch) {
caseBit = TRUE;
}
} else {
if(newExtensionsLen == 0) {
extensionOffset = src->current - src->source;
@ -220,11 +225,17 @@ uint32_t ucol_uprv_tok_assembleTokenList(UColTokenParser *src, UErrorCode *statu
if (newCharsLen == 0) {
charsOffset = src->current - src->source;
newCharsLen++;
if(u_tolower(ch)!=ch) {
caseBit = TRUE;
}
} else if (inChars) {
if(newCharsLen == 0) {
charsOffset = src->current - src->source;
}
newCharsLen++;
if(u_tolower(ch)!=ch) {
caseBit = TRUE;
}
} else {
newExtensionsLen++;
}
@ -257,11 +268,17 @@ uint32_t ucol_uprv_tok_assembleTokenList(UColTokenParser *src, UErrorCode *statu
charsOffset = src->current - src->source;
}
newCharsLen++;
if(u_tolower(ch)!=ch) {
caseBit = TRUE;
}
} else {
if(newExtensionsLen == 0) {
extensionOffset = src->current - src->source;
}
newExtensionsLen++;
if(u_tolower(ch)!=ch) {
caseBit = TRUE;
}
}
break;
@ -303,6 +320,7 @@ uint32_t ucol_uprv_tok_assembleTokenList(UColTokenParser *src, UErrorCode *statu
sourceToken = (UColToken *)uprv_malloc(sizeof(UColToken));
sourceToken->source = newCharsLen << 24 | charsOffset;
sourceToken->expansion = newExtensionsLen << 24 | extensionOffset;
sourceToken->caseBit = caseBit;
sourceToken->debugSource = *(src->source + charsOffset);
if(newExtensionsLen > 0) {

View File

@ -53,6 +53,7 @@ struct UColToken {
UColTokListHeader *listHeader;
UColToken* previous;
UColToken* next;
UBool caseBit;
};
typedef struct {