/*
*******************************************************************************
*
-* Copyright (C) 2004-2013, International Business Machines
+* Copyright (C) 2004-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
const int32_t *indexes;
const uint32_t *mirrors;
const uint8_t *jgArray;
+ const uint8_t *jgArray2;
UTrie2 trie;
uint8_t formatVersion[4];
start=bdp->indexes[UBIDI_IX_JG_START];
limit=bdp->indexes[UBIDI_IX_JG_LIMIT];
jgArray=bdp->jgArray;
- prev=0;
- while(start<limit) {
- jg=*jgArray++;
- if(jg!=prev) {
- sa->add(sa->set, start);
- prev=jg;
+ for(;;) {
+ prev=0;
+ while(start<limit) {
+ jg=*jgArray++;
+ if(jg!=prev) {
+ sa->add(sa->set, start);
+ prev=jg;
+ }
+ ++start;
+ }
+ if(prev!=0) {
+ /* add the limit code point if the last value was not 0 (it is now start==limit) */
+ sa->add(sa->set, limit);
+ }
+ if(limit==bdp->indexes[UBIDI_IX_JG_LIMIT]) {
+ /* switch to the second Joining_Group range */
+ start=bdp->indexes[UBIDI_IX_JG_START2];
+ limit=bdp->indexes[UBIDI_IX_JG_LIMIT2];
+ jgArray=bdp->jgArray2;
+ } else {
+ break;
}
- ++start;
- }
- if(prev!=0) {
- /* add the limit code point if the last value was not 0 (it is now start==limit) */
- sa->add(sa->set, limit);
}
/* add code points with hardcoded properties, plus the ones following them */
limit=bdp->indexes[UBIDI_IX_JG_LIMIT];
if(start<=c && c<limit) {
return (UJoiningGroup)bdp->jgArray[c-start];
- } else {
- return U_JG_NO_JOINING_GROUP;
}
+ start=bdp->indexes[UBIDI_IX_JG_START2];
+ limit=bdp->indexes[UBIDI_IX_JG_LIMIT2];
+ if(start<=c && c<limit) {
+ return (UJoiningGroup)bdp->jgArray2[c-start];
+ }
+ return U_JG_NO_JOINING_GROUP;
}
U_CFUNC UBidiPairedBracketType