src/main/java/com/basistech/tclre/ColorMap.java
private short subcolor(int c, int rangeCount) throws RegexException {
        short co;           /* current color of c */
        short sco;          /* new subcolor */

        co = getcolor(c);
        sco = newsub(co);
        assert sco != Constants.COLORLESS;

        if (co == sco)      /* already in an open subcolor */ {
            return co;  /* rest is redundant */
        }

        ColorDesc cd = colorDescs.get(co);
        cd.incrementNChars(-rangeCount);
        ColorDesc scd = colorDescs.get(sco);
        scd.incrementNChars(rangeCount);

        map.put(Range.closedOpen(c, c + rangeCount), sco);
        return sco;
    }
private short subcolor(int c, int rangeCount) throws RegexException {
        short co;           /* current color of c */
        short sco;          /* new subcolor */

        co = getcolor(c);
        sco = newsub(co);
        assert sco != Constants.COLORLESS;

        if (co == sco)      /* already in an open subcolor */ {
            return co;  /* rest is redundant */
        }

        ColorDesc cd = colorDescs.get(co);
        cd.incrementNChars(-rangeCount);
        ColorDesc scd = colorDescs.get(sco);
        scd.incrementNChars(rangeCount);

        map.put(Range.closedOpen(c, c + rangeCount), sco);
        return sco;
    }
private short subcolor ( int c , int rangeCount ) throws RegexException { short co ; /* current color of c */ short sco ; /* new subcolor */ co = getcolor ( c ) ; sco = newsub ( co ) ; assert sco != Constants . COLORLESS ; if ( co == sco ) /* already in an open subcolor */ { return co ; /* rest is redundant */ } ColorDesc cd = colorDescs . get ( co ) ; cd . incrementNChars ( - rangeCount ) ; ColorDesc scd = colorDescs . get ( sco ) ; scd . incrementNChars ( rangeCount ) ; map . put ( Range . closedOpen ( c , c + rangeCount ) , sco ) ; return sco ; }
subcolor - allocate a new subcolor (if necessary) to this char
Internal API that can do a range of characters; called from
{@link #subrange}.

@param c The character, or first character in a range, to process.
@param rangeCount the number of characters.
subcolor - allocate a new subcolor ( if necessary ) to this char Internal API that can do a range of characters ; called from { @link #subrange } .