[jruby-joni] 173/194: pass scan env to coderange buffer routines

Hideki Yamane henrich at moszumanska.debian.org
Thu Feb 1 12:04:38 UTC 2018


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository jruby-joni.

commit ce0dc83125c927bfa540720533dd6a99ca8aaf52
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Wed Jan 17 18:04:27 2018 +0100

    pass scan env to coderange buffer routines
---
 src/org/joni/ApplyCaseFold.java   |  2 +-
 src/org/joni/CodeRangeBuffer.java | 61 +++++++++++++++++++--------------
 src/org/joni/Parser.java          | 20 +++++------
 src/org/joni/ast/CClassNode.java  | 72 +++++++++++++++++++--------------------
 4 files changed, 83 insertions(+), 72 deletions(-)

diff --git a/src/org/joni/ApplyCaseFold.java b/src/org/joni/ApplyCaseFold.java
index af755ec..c08a1e5 100644
--- a/src/org/joni/ApplyCaseFold.java
+++ b/src/org/joni/ApplyCaseFold.java
@@ -64,7 +64,7 @@ final class ApplyCaseFold implements ApplyAllCaseFoldFunction {
                 if (inCC) {
                     if (addFlag) {
                         if (enc.minLength() > 1 || to[0] >= BitSet.SINGLE_BYTE_SIZE) {
-                            if (cc.isNot()) cc.clearNotFlag(enc);
+                            if (cc.isNot()) cc.clearNotFlag(env);
                             cc.addCodeRange(env, to[0], to[0]);
                         } else {
                             if (cc.isNot()) {
diff --git a/src/org/joni/CodeRangeBuffer.java b/src/org/joni/CodeRangeBuffer.java
index e046f03..1f87749 100644
--- a/src/org/joni/CodeRangeBuffer.java
+++ b/src/org/joni/CodeRangeBuffer.java
@@ -93,9 +93,12 @@ public final class CodeRangeBuffer {
         return new CodeRangeBuffer(this);
     }
 
-    // ugly part: these methods should be made OO
     // add_code_range_to_buf
-    public static CodeRangeBuffer addCodeRangeToBuff(CodeRangeBuffer pbuf, int from, int to) {
+    public static CodeRangeBuffer addCodeRangeToBuff(CodeRangeBuffer pbuf, ScanEnvironment env, int from, int to) {
+        return addCodeRangeToBuff(pbuf, env, from, to, true);
+    }
+
+    public static CodeRangeBuffer addCodeRangeToBuff(CodeRangeBuffer pbuf, ScanEnvironment env, int from, int to, boolean checkDup) {
         if (from > to) {
             int n = from;
             from = to;
@@ -134,6 +137,10 @@ public final class CodeRangeBuffer {
         if (n + incN > Config.MAX_MULTI_BYTE_RANGES_NUM) throw new ValueException(ErrorMessages.ERR_TOO_MANY_MULTI_BYTE_RANGES);
 
         if (incN != 1) {
+            if (checkDup) {
+                // if (from <= p[low * 2 + 2] && (p[low * 2 + 1] <= from || p[low * 2 + 2] <= to)) env.ccDuplicateWarn();
+            }
+
             if (from > p[low * 2 + 1]) from = p[low * 2 + 1];
             if (to < p[(high - 1) * 2 + 2]) to = p[(high - 1) * 2 + 2];
         }
@@ -164,6 +171,10 @@ public final class CodeRangeBuffer {
 
     // add_code_range, be aware of it returning null!
     public static CodeRangeBuffer addCodeRange(CodeRangeBuffer pbuf, ScanEnvironment env, int from, int to) {
+        return addCodeRange(pbuf, env, from, to, true);
+    }
+
+    public static CodeRangeBuffer addCodeRange(CodeRangeBuffer pbuf, ScanEnvironment env, int from, int to, boolean checkDup) {
         if (from >to) {
             if (env.syntax.allowEmptyRangeInCC()) {
                 return pbuf;
@@ -171,32 +182,32 @@ public final class CodeRangeBuffer {
                 throw new ValueException(ErrorMessages.ERR_EMPTY_RANGE_IN_CHAR_CLASS);
             }
         }
-        return addCodeRangeToBuff(pbuf, from, to);
+        return addCodeRangeToBuff(pbuf, env, from, to, checkDup);
     }
 
     // SET_ALL_MULTI_BYTE_RANGE
-    protected static CodeRangeBuffer setAllMultiByteRange(Encoding enc, CodeRangeBuffer pbuf) {
-        return addCodeRangeToBuff(pbuf, enc.mbcodeStartPosition(), ALL_MULTI_BYTE_RANGE);
+    protected static CodeRangeBuffer setAllMultiByteRange(ScanEnvironment env, CodeRangeBuffer pbuf) {
+        return addCodeRangeToBuff(pbuf, env, env.enc.mbcodeStartPosition(), ALL_MULTI_BYTE_RANGE);
     }
 
     // ADD_ALL_MULTI_BYTE_RANGE
-    public static CodeRangeBuffer addAllMultiByteRange(Encoding enc, CodeRangeBuffer pbuf) {
-        if (!enc.isSingleByte()) return setAllMultiByteRange(enc, pbuf);
+    public static CodeRangeBuffer addAllMultiByteRange(ScanEnvironment env, CodeRangeBuffer pbuf) {
+        if (!env.enc.isSingleByte()) return setAllMultiByteRange(env, pbuf);
         return pbuf;
     }
 
     // not_code_range_buf
-    public static CodeRangeBuffer notCodeRangeBuff(Encoding enc, CodeRangeBuffer bbuf) {
+    public static CodeRangeBuffer notCodeRangeBuff(ScanEnvironment env, CodeRangeBuffer bbuf) {
         CodeRangeBuffer pbuf = null;
 
-        if (bbuf == null) return setAllMultiByteRange(enc, pbuf);
+        if (bbuf == null) return setAllMultiByteRange(env, pbuf);
 
         int[]p = bbuf.p;
         int n = p[0];
 
-        if (n <= 0) return setAllMultiByteRange(enc, pbuf);
+        if (n <= 0) return setAllMultiByteRange(env, pbuf);
 
-        int pre = enc.mbcodeStartPosition();
+        int pre = env.enc.mbcodeStartPosition();
 
         int from;
         int to = 0;
@@ -204,24 +215,24 @@ public final class CodeRangeBuffer {
             from = p[i * 2 + 1];
             to = p[i * 2 + 2];
             if (pre <= from - 1) {
-                pbuf = addCodeRangeToBuff(pbuf, pre, from - 1);
+                pbuf = addCodeRangeToBuff(pbuf, env, pre, from - 1);
             }
             if (to == ALL_MULTI_BYTE_RANGE) break;
             pre = to + 1;
         }
 
-        if (to < ALL_MULTI_BYTE_RANGE) pbuf = addCodeRangeToBuff(pbuf, to + 1, ALL_MULTI_BYTE_RANGE);
+        if (to < ALL_MULTI_BYTE_RANGE) pbuf = addCodeRangeToBuff(pbuf, env, to + 1, ALL_MULTI_BYTE_RANGE);
         return pbuf;
     }
 
     // or_code_range_buf
-    public static CodeRangeBuffer orCodeRangeBuff(Encoding enc, CodeRangeBuffer bbuf1, boolean not1,
+    public static CodeRangeBuffer orCodeRangeBuff(ScanEnvironment env, CodeRangeBuffer bbuf1, boolean not1,
                                                                 CodeRangeBuffer bbuf2, boolean not2) {
         CodeRangeBuffer pbuf = null;
 
         if (bbuf1 == null && bbuf2 == null) {
             if (not1 || not2) {
-                return setAllMultiByteRange(enc, pbuf);
+                return setAllMultiByteRange(env, pbuf);
             }
             return null;
         }
@@ -236,12 +247,12 @@ public final class CodeRangeBuffer {
 
         if (bbuf1 == null) {
             if (not1) {
-                return setAllMultiByteRange(enc, pbuf);
+                return setAllMultiByteRange(env, pbuf);
             } else {
                 if (!not2) {
                     return bbuf2.clone();
                 } else {
-                    return notCodeRangeBuff(enc, bbuf2);
+                    return notCodeRangeBuff(env, bbuf2);
                 }
             }
         }
@@ -257,7 +268,7 @@ public final class CodeRangeBuffer {
         if (!not2 && !not1) { /* 1 OR 2 */
             pbuf = bbuf2.clone();
         } else if (!not1) { /* 1 OR (not 2) */
-            pbuf = notCodeRangeBuff(enc, bbuf2);
+            pbuf = notCodeRangeBuff(env, bbuf2);
         }
 
         int[]p1 = bbuf1.p;
@@ -266,14 +277,14 @@ public final class CodeRangeBuffer {
         for (int i=0; i<n1; i++) {
             int from = p1[i * 2 + 1];
             int to = p1[i * 2 + 2];
-            pbuf = addCodeRangeToBuff(pbuf, from, to);
+            pbuf = addCodeRangeToBuff(pbuf, env, from, to);
         }
 
         return pbuf;
     }
 
     // and_code_range1
-    public static CodeRangeBuffer andCodeRange1(CodeRangeBuffer pbuf, int from1, int to1, int[]data, int n) {
+    public static CodeRangeBuffer andCodeRange1(CodeRangeBuffer pbuf, ScanEnvironment env, int from1, int to1, int[]data, int n) {
         for (int i=0; i<n; i++) {
             int from2 = data[i * 2 + 1];
             int to2 = data[i * 2 + 2];
@@ -286,7 +297,7 @@ public final class CodeRangeBuffer {
             } else if (from2 <= to1) {
                 if (to2 < to1) {
                     if (from1 <= from2 - 1) {
-                        pbuf = addCodeRangeToBuff(pbuf, from1, from2 - 1);
+                        pbuf = addCodeRangeToBuff(pbuf, env, from1, from2 - 1);
                     }
                     from1 = to2 + 1;
                 } else {
@@ -299,7 +310,7 @@ public final class CodeRangeBuffer {
         }
 
         if (from1 <= to1) {
-            pbuf = addCodeRangeToBuff(pbuf, from1, to1);
+            pbuf = addCodeRangeToBuff(pbuf, env, from1, to1);
         }
 
         return pbuf;
@@ -307,7 +318,7 @@ public final class CodeRangeBuffer {
 
     // and_code_range_buf
     public static CodeRangeBuffer andCodeRangeBuff(CodeRangeBuffer bbuf1, boolean not1,
-                                                   CodeRangeBuffer bbuf2, boolean not2) {
+                                                   CodeRangeBuffer bbuf2, boolean not2, ScanEnvironment env) {
         CodeRangeBuffer pbuf = null;
 
         if (bbuf1 == null) {
@@ -344,14 +355,14 @@ public final class CodeRangeBuffer {
                     if (to2 < from1) continue;
                     int from = from1 > from2 ? from1 : from2;
                     int to = to1 < to2 ? to1 : to2;
-                    pbuf = addCodeRangeToBuff(pbuf, from, to);
+                    pbuf = addCodeRangeToBuff(pbuf, env, from, to);
                 }
             }
         } else if (!not1) { /* 1 AND (not 2) */
             for (int i=0; i<n1; i++) {
                 int from1 = p1[i * 2 + 1];
                 int to1 = p1[i * 2 + 2];
-                pbuf = andCodeRange1(pbuf, from1, to1, p2, n2);
+                pbuf = andCodeRange1(pbuf, env, from1, to1, p2, n2);
             }
         }
 
diff --git a/src/org/joni/Parser.java b/src/org/joni/Parser.java
index b668e3a..6edf81a 100644
--- a/src/org/joni/Parser.java
+++ b/src/org/joni/Parser.java
@@ -311,9 +311,9 @@ class Parser extends Lexer {
             case CC_CC_OPEN: /* [ */
                 ObjPtr<CClassNode> ascPtr = new ObjPtr<CClassNode>();
                 CClassNode acc = parseCharClass(ascPtr);
-                cc.or(acc, enc);
+                cc.or(acc, env);
                 if (ascPtr.p != null) {
-                    ascCc.or(ascPtr.p, enc);
+                    ascCc.or(ascPtr.p, env);
                 }
                 break;
 
@@ -327,9 +327,9 @@ class Parser extends Lexer {
                 andStart = true;
                 arg.state = CCSTATE.START;
                 if (prevCc != null) {
-                    prevCc.and(cc, enc);
+                    prevCc.and(cc, env);
                     if (ascCc != null) {
-                        ascPrevCc.and(ascCc, enc);
+                        ascPrevCc.and(ascCc, env);
                     }
                 } else {
                     prevCc = cc;
@@ -363,10 +363,10 @@ class Parser extends Lexer {
         }
 
         if (prevCc != null) {
-            prevCc.and(cc, enc);
+            prevCc.and(cc, env);
             cc = prevCc;
             if (ascCc != null) {
-                ascPrevCc.and(ascCc, enc);
+                ascPrevCc.and(ascCc, env);
                 ascCc = ascPrevCc;
             }
         }
@@ -979,7 +979,7 @@ class Parser extends Lexer {
                 CodeRangeBuffer buff = new CodeRangeBuffer();
                 buff = CodeRangeBuffer.addCodeRange(buff, env, 0x0a, 0x0a);
                 buff = CodeRangeBuffer.addCodeRange(buff, env, 0x0d, 0x0d);
-                cc.mbuf = CodeRangeBuffer.andCodeRangeBuff(cc.mbuf, false, buff, true);
+                cc.mbuf = CodeRangeBuffer.andCodeRangeBuff(cc.mbuf, false, buff, true, env);
             } else {
                 cc.bs.clear(0x0a);
                 cc.bs.clear(0x0d);
@@ -1106,7 +1106,7 @@ class Parser extends Lexer {
             list2 = ListNode.newList(qn, null);
 
             cc = new CClassNode();
-            cc.addCTypeByRange(-1, false, enc, sbOut, GraphemeNames.Glue_After_Zwj_Ranges);
+            cc.addCTypeByRange(-1, false, env, sbOut, GraphemeNames.Glue_After_Zwj_Ranges);
             cc.addCType(GraphemeNames.nameToCtype(enc, GraphemeNames.Grapheme_Cluster_Break_Glue_After_Zwj), false, false, env, this);
             list2 = ListNode.newList(cc, list2);
 
@@ -1124,7 +1124,7 @@ class Parser extends Lexer {
             list2 = ListNode.newList(qn, null);
 
             cc = new CClassNode();
-            cc.addCTypeByRange(-1, false, enc, sbOut, GraphemeNames.Emoji_Ranges);
+            cc.addCTypeByRange(-1, false, env, sbOut, GraphemeNames.Emoji_Ranges);
             list2 = ListNode.newList(cc, list2);
 
             alt2 = ListNode.newAlt(list2, alt2);
@@ -1157,7 +1157,7 @@ class Parser extends Lexer {
 
             /* (E_Base | EBG) */
             cc = new CClassNode();
-            cc.addCTypeByRange(-1, false, enc, sbOut, GraphemeNames.E_Base_Ranges);
+            cc.addCTypeByRange(-1, false, env, sbOut, GraphemeNames.E_Base_Ranges);
             cc.addCType(GraphemeNames.nameToCtype(enc, GraphemeNames.Grapheme_Cluster_Break_E_Base), false, false, env, this);
             cc.addCType(GraphemeNames.nameToCtype(enc, GraphemeNames.Grapheme_Cluster_Break_E_Base_GAZ), false, false, env, this);
             list2 = ListNode.newList(cc, list2);
diff --git a/src/org/joni/ast/CClassNode.java b/src/org/joni/ast/CClassNode.java
index ab18b2e..1a2ea51 100644
--- a/src/org/joni/ast/CClassNode.java
+++ b/src/org/joni/ast/CClassNode.java
@@ -73,23 +73,23 @@ public final class CClassNode extends Node {
         return mbuf == null && bs.isEmpty();
     }
 
-    void addCodeRangeToBuf(int from, int to) {
-        mbuf = CodeRangeBuffer.addCodeRangeToBuff(mbuf, from, to);
+    void addCodeRangeToBuf(ScanEnvironment env, int from, int to) {
+        mbuf = CodeRangeBuffer.addCodeRangeToBuff(mbuf, env, from, to);
     }
 
     public void addCodeRange(ScanEnvironment env, int from, int to) {
         mbuf = CodeRangeBuffer.addCodeRange(mbuf, env, from, to);
     }
 
-    void addAllMultiByteRange(Encoding enc) {
-        mbuf = CodeRangeBuffer.addAllMultiByteRange(enc, mbuf);
+    void addAllMultiByteRange(ScanEnvironment env) {
+        mbuf = CodeRangeBuffer.addAllMultiByteRange(env, mbuf);
     }
 
-    public void clearNotFlag(Encoding enc) {
+    public void clearNotFlag(ScanEnvironment env) {
         if (isNot()) {
             bs.invert();
-            if (!enc.isSingleByte()) {
-                mbuf = CodeRangeBuffer.notCodeRangeBuff(enc, mbuf);
+            if (!env.enc.isSingleByte()) {
+                mbuf = CodeRangeBuffer.notCodeRangeBuff(env, mbuf);
             }
             clearNot();
         }
@@ -124,7 +124,7 @@ public final class CClassNode extends Node {
     }
 
     // and_cclass
-    public void and(CClassNode other, Encoding enc) {
+    public void and(CClassNode other, ScanEnvironment env) {
         boolean not1 = isNot();
         BitSet bsr1 = bs;
         CodeRangeBuffer buf1 = mbuf;
@@ -157,14 +157,14 @@ public final class CClassNode extends Node {
 
         CodeRangeBuffer pbuf = null;
 
-        if (!enc.isSingleByte()) {
+        if (!env.enc.isSingleByte()) {
             if (not1 && not2) {
-                pbuf = CodeRangeBuffer.orCodeRangeBuff(enc, buf1, false, buf2, false);
+                pbuf = CodeRangeBuffer.orCodeRangeBuff(env, buf1, false, buf2, false);
             } else {
-                pbuf = CodeRangeBuffer.andCodeRangeBuff(buf1, not1, buf2, not2);
+                pbuf = CodeRangeBuffer.andCodeRangeBuff(buf1, not1, buf2, not2, env);
 
                 if (not1) {
-                    pbuf = CodeRangeBuffer.notCodeRangeBuff(enc, pbuf);
+                    pbuf = CodeRangeBuffer.notCodeRangeBuff(env, pbuf);
                 }
             }
             mbuf = pbuf;
@@ -173,7 +173,7 @@ public final class CClassNode extends Node {
     }
 
     // or_cclass
-    public void or(CClassNode other, Encoding enc) {
+    public void or(CClassNode other, ScanEnvironment env) {
         boolean not1 = isNot();
         BitSet bsr1 = bs;
         CodeRangeBuffer buf1 = mbuf;
@@ -204,14 +204,14 @@ public final class CClassNode extends Node {
             bs.invert();
         }
 
-        if (!enc.isSingleByte()) {
+        if (!env.enc.isSingleByte()) {
             CodeRangeBuffer pbuf = null;
             if (not1 && not2) {
-                pbuf = CodeRangeBuffer.andCodeRangeBuff(buf1, false, buf2, false);
+                pbuf = CodeRangeBuffer.andCodeRangeBuff(buf1, false, buf2, false, env);
             } else {
-                pbuf = CodeRangeBuffer.orCodeRangeBuff(enc, buf1, not1, buf2, not2);
+                pbuf = CodeRangeBuffer.orCodeRangeBuff(env, buf1, not1, buf2, not2);
                 if (not1) {
-                    pbuf = CodeRangeBuffer.notCodeRangeBuff(enc, pbuf);
+                    pbuf = CodeRangeBuffer.notCodeRangeBuff(env, pbuf);
                 }
             }
             mbuf = pbuf;
@@ -219,7 +219,7 @@ public final class CClassNode extends Node {
     }
 
     // add_ctype_to_cc_by_range // Encoding out!
-    public void addCTypeByRange(int ctype, boolean not, Encoding enc, int sbOut, int mbr[]) {
+    public void addCTypeByRange(int ctype, boolean not, ScanEnvironment env, int sbOut, int mbr[]) {
         int n = mbr[0];
         int i;
 
@@ -228,12 +228,12 @@ public final class CClassNode extends Node {
                 for (int j=CR_FROM(mbr, i); j<=CR_TO(mbr, i); j++) {
                     if (j >= sbOut) {
                         if (j > CR_FROM(mbr, i)) {
-                            addCodeRangeToBuf(j, CR_TO(mbr, i));
+                            addCodeRangeToBuf(env, j, CR_TO(mbr, i));
                             i++;
                         }
                         // !goto sb_end!, remove duplication!
                         for (; i<n; i++) {
-                            addCodeRangeToBuf(CR_FROM(mbr, i), CR_TO(mbr, i));
+                            addCodeRangeToBuf(env, CR_FROM(mbr, i), CR_TO(mbr, i));
                         }
                         return;
                     }
@@ -242,7 +242,7 @@ public final class CClassNode extends Node {
             }
             // !sb_end:!
             for (; i<n; i++) {
-                addCodeRangeToBuf(CR_FROM(mbr, i), CR_TO(mbr, i));
+                addCodeRangeToBuf(env, CR_FROM(mbr, i), CR_TO(mbr, i));
             }
 
         } else {
@@ -254,10 +254,10 @@ public final class CClassNode extends Node {
                         // !goto sb_end2!, remove duplication
                         prev = sbOut;
                         for (i=0; i<n; i++) {
-                            if (prev < CR_FROM(mbr, i)) addCodeRangeToBuf(prev, CR_FROM(mbr, i) - 1);
+                            if (prev < CR_FROM(mbr, i)) addCodeRangeToBuf(env, prev, CR_FROM(mbr, i) - 1);
                             prev = CR_TO(mbr, i) + 1;
                         }
-                        if (prev < 0x7fffffff/*!!!*/) addCodeRangeToBuf(prev, 0x7fffffff);
+                        if (prev < 0x7fffffff/*!!!*/) addCodeRangeToBuf(env, prev, 0x7fffffff);
                         return;
                     }
                     bs.set(j);
@@ -272,10 +272,10 @@ public final class CClassNode extends Node {
             // !sb_end2:!
             prev = sbOut;
             for (i=0; i<n; i++) {
-                if (prev < CR_FROM(mbr, i)) addCodeRangeToBuf(prev, CR_FROM(mbr, i) - 1);
+                if (prev < CR_FROM(mbr, i)) addCodeRangeToBuf(env, prev, CR_FROM(mbr, i) - 1);
                 prev = CR_TO(mbr, i) + 1;
             }
-            if (prev < 0x7fffffff/*!!!*/) addCodeRangeToBuf(prev, 0x7fffffff);
+            if (prev < 0x7fffffff/*!!!*/) addCodeRangeToBuf(env, prev, 0x7fffffff);
         }
     }
 
@@ -294,21 +294,21 @@ public final class CClassNode extends Node {
         if (ranges != null) {
             if (asciiRange) {
                 CClassNode ccWork = new CClassNode();
-                ccWork.addCTypeByRange(ctype, not, enc, sbOut.value, ranges);
+                ccWork.addCTypeByRange(ctype, not, env, sbOut.value, ranges);
                 if (not) {
-                    ccWork.addCodeRangeToBuf(0x80, CodeRangeBuffer.ALL_MULTI_BYTE_RANGE); // add_code_range_to_buf0
+                    ccWork.addCodeRangeToBuf(env, 0x80, CodeRangeBuffer.ALL_MULTI_BYTE_RANGE); // add_code_range_to_buf0
                 } else {
                     CClassNode ccAscii = new CClassNode();
                     if (enc.minLength() > 1) {
-                        ccAscii.addCodeRangeToBuf(0x00, 0x7F);
+                        ccAscii.addCodeRangeToBuf(env, 0x00, 0x7F);
                     } else {
                         ccAscii.bs.setRange(0x00, 0x7F);
                     }
-                    ccWork.and(ccAscii, enc);
+                    ccWork.and(ccAscii, env);
                 }
-                or(ccWork, enc);
+                or(ccWork, env);
             } else {
-                addCTypeByRange(ctype, not, enc, sbOut.value, ranges);
+                addCTypeByRange(ctype, not, env, sbOut.value, ranges);
             }
             return;
         }
@@ -330,7 +330,7 @@ public final class CClassNode extends Node {
                 for (int c=0; c<BitSet.SINGLE_BYTE_SIZE; c++) {
                     if (!enc.isCodeCType(c, ctype)) bs.set(c);
                 }
-                addAllMultiByteRange(enc);
+                addAllMultiByteRange(env);
             } else {
                 for (int c=0; c<BitSet.SINGLE_BYTE_SIZE; c++) {
                     if (enc.isCodeCType(c, ctype)) bs.set(c);
@@ -344,12 +344,12 @@ public final class CClassNode extends Node {
                 for (int c=0; c<BitSet.SINGLE_BYTE_SIZE; c++) {
                     if (!enc.isCodeCType(c, ctype) || c >= maxCode) bs.set(c);
                 }
-                if (asciiRange) addAllMultiByteRange(enc);
+                if (asciiRange) addAllMultiByteRange(env);
             } else {
                 for (int c=0; c<maxCode; c++) {
                     if (enc.isCodeCType(c, ctype)) bs.set(c);
                 }
-                if (!asciiRange) addAllMultiByteRange(enc);
+                if (!asciiRange) addAllMultiByteRange(env);
             }
             break;
 
@@ -358,13 +358,13 @@ public final class CClassNode extends Node {
                 for (int c=0; c<maxCode; c++) {
                     if (enc.isSbWord(c)) bs.set(c);
                 }
-                if (!asciiRange) addAllMultiByteRange(enc);
+                if (!asciiRange) addAllMultiByteRange(env);
             } else {
                 for (int c=0; c<BitSet.SINGLE_BYTE_SIZE; c++) {
                     if (enc.codeToMbcLength(c) > 0 && /* check invalid code point */
                             !(enc.isWord(c) || c >= maxCode)) bs.set(c);
                 }
-                if (asciiRange) addAllMultiByteRange(enc);
+                if (asciiRange) addAllMultiByteRange(env);
             }
             break;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby-joni.git



More information about the pkg-java-commits mailing list