]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/rbbiscan.cpp
ICU-551.24.tar.gz
[apple/icu.git] / icuSources / common / rbbiscan.cpp
index 0113c08ed377d25afca0912c12c261736da6163b..13a33210582ebecd06fac2bb78486bc7d3b48a57 100644 (file)
@@ -2,7 +2,7 @@
 //
 //  file:  rbbiscan.cpp
 //
-//  Copyright (C) 2002-2012, International Business Machines Corporation and others.
+//  Copyright (C) 2002-2014, International Business Machines Corporation and others.
 //  All Rights Reserved.
 //
 //  This file contains the Rule Based Break Iterator Rule Builder functions for
@@ -35,8 +35,6 @@
 
 #include "uassert.h"
 
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-
 //------------------------------------------------------------------------------
 //
 // Unicode Set init strings for each of the character classes needed for parsing a rule file.
@@ -490,6 +488,8 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
                 fRB->fChainRules = TRUE;
             } else if (opt == UNICODE_STRING("LBCMNoChain", 11)) {
                 fRB->fLBCMNoChain = TRUE;
+            } else if (opt == UNICODE_STRING("RINoChain", 9)) {
+                fRB->fRINoChain = TRUE;
             } else if (opt == UNICODE_STRING("forward", 7)) {
                 fRB->fDefaultTree   = &fRB->fForwardTree;
             } else if (opt == UNICODE_STRING("reverse", 7)) {
@@ -581,7 +581,7 @@ void RBBIRuleScanner::error(UErrorCode e) {
             fRB->fParseError->line  = fLineNum;
             fRB->fParseError->offset = fCharNum;
             fRB->fParseError->preContext[0] = 0;
-            fRB->fParseError->preContext[0] = 0;
+            fRB->fParseError->postContext[0] = 0;
         }
     }
 }
@@ -993,7 +993,7 @@ void RBBIRuleScanner::parse() {
             if (tableEl->fCharClass >= 128 && tableEl->fCharClass < 240 &&   // Table specs a char class &&
                 fC.fEscaped == FALSE &&                                      //   char is not escaped &&
                 fC.fChar != (UChar32)-1) {                                   //   char is not EOF
-                U_ASSERT((tableEl->fCharClass-128) < LENGTHOF(fRuleSets));
+                U_ASSERT((tableEl->fCharClass-128) < UPRV_LENGTHOF(fRuleSets));
                 if (fRuleSets[tableEl->fCharClass-128].contains(fC.fChar)) {
                     // Table row specified a character class, or set of characters,
                     //   and the current char matches it.