Ignore:
Timestamp:
Jun 9, 2016, 4:15:48 PM (3 years ago)
Author:
xuedongx
Message:

fix index

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r5045 r5046  
    4444
    4545void RE_Compiler::initializeRequiredStreams(Encoding encoding) {
    46         if (encoding.getType() == Encoding::Type::UTF_8) {
    47                 RE_Compiler::initializeRequiredStreams_utf8();
    48         }
    49         else if (encoding.getType() == Encoding::Type::UTF_16) {
    50                 RE_Compiler::initializeRequiredStreams_utf16();
    51         }
     46    if (encoding.getType() == Encoding::Type::UTF_8) {
     47            RE_Compiler::initializeRequiredStreams_utf8();
     48    }
     49    else if (encoding.getType() == Encoding::Type::UTF_16) {
     50            RE_Compiler::initializeRequiredStreams_utf16();
     51    }
    5252}
    5353               
     
    6464    mCRLF = acrlf;
    6565
    66         PabloAST * hi_surrogate = mCCCompiler.compileCC(makeCC(0xD800, 0xDBFF));
    67         //PabloAST * lo_surrogate = mCCCompiler.compileCC(makeCC(0xDC00, 0xDFFF));
    68         PabloAST * u16hi_hi_surrogate = mCCCompiler.compileCC(makeCC(0xD800, 0xDB00));    //u16hi_hi_surrogate = [\xD8-\xDB]
    69         PabloAST * u16hi_lo_surrogate = mCCCompiler.compileCC(makeCC(0xDC00, 0xDF00));    //u16hi_lo_surrogate = [\xDC-\xDF]
    70 
    71         PabloAST * invalidTemp = mPB.createAdvance(u16hi_hi_surrogate, 1, "InvalidTemp");
     66    PabloAST * hi_surrogate = mCCCompiler.compileCC(makeCC(0xD800, 0xDBFF));
     67    //PabloAST * lo_surrogate = mCCCompiler.compileCC(makeCC(0xDC00, 0xDFFF));
     68    PabloAST * u16hi_hi_surrogate = mCCCompiler.compileCC(makeCC(0xD800, 0xDB00));    //u16hi_hi_surrogate = [\xD8-\xDB]
     69    PabloAST * u16hi_lo_surrogate = mCCCompiler.compileCC(makeCC(0xDC00, 0xDF00));    //u16hi_lo_surrogate = [\xDC-\xDF]
     70
     71    PabloAST * invalidTemp = mPB.createAdvance(u16hi_hi_surrogate, 1, "InvalidTemp");
    7272    Assign * u16invalid = mPB.createAssign("u16invalid", mPB.createXor(invalidTemp, u16hi_lo_surrogate));//errors.Unicode=pablo.Advance(u16hi_hi_surrogate) ^ u16hi_lo_surrogate
    7373    Assign * u16valid = mPB.createAssign("u16valid", mPB.createNot(u16invalid));
    7474
    7575    PabloAST * u16single_temp = mPB.createOr(mCCCompiler.compileCC(makeCC(0x0000, 0xD7FF)), mCCCompiler.compileCC(makeCC(0xE000, 0xFFFF)));
    76         PabloAST * u16single = mPB.createAnd(u16single_temp, mPB.createNot(u16invalid));
     76    PabloAST * u16single = mPB.createAnd(u16single_temp, mPB.createNot(u16invalid));
    7777   
    7878    mNonFinal = mPB.createAssign("nonfinal", mPB.createAnd(hi_surrogate, u16valid));
    7979    mFinal = mPB.createNot(mPB.createOr(mNonFinal, u16invalid), "final");
    80         mInitial = mPB.createOr(u16single, hi_surrogate, "initial");
     80    mInitial = mPB.createOr(u16single, hi_surrogate, "initial");
    8181   
    8282    PabloAST * LB_chars = mPB.createOr(LF_VT_FF_CR, NEL_LS_PS);
     
    8787    mAny = mPB.createNot(lb, "any");
    8888    mFunction.setResult(1, mPB.createAssign("lf", mLineBreak));
    89         return;
     89    return;
    9090}
    9191void RE_Compiler::initializeRequiredStreams_utf8() {
Note: See TracChangeset for help on using the changeset viewer.