Ignore:
Timestamp:
Mar 30, 2017, 8:12:59 PM (2 years ago)
Author:
cameron
Message:

Lookahead support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/linebreak_kernel.cpp

    r5370 r5383  
    4141    Var * crlf = builder.createVar("crlf", zero);
    4242    PabloBuilder crb = PabloBuilder::Create(builder);
    43     PabloAST * cr1 = crb.createAdvance(CR, 1, "cr1");
    44     crb.createAssign(crlf, crb.createAnd(cr1, LF));
     43    //PabloAST * cr1 = crb.createAdvance(CR, 1, "cr1");
     44    //crb.createAssign(crlf, crb.createAnd(cr1, LF));
     45    PabloAST * lookaheadLF = crb.createLookahead(LF, 1, "lookaheadLF");
     46    crb.createAssign(crlf, crb.createAnd(CR, lookaheadLF));
    4547    builder.createIf(CR, crb);
    4648   
     
    7375    PabloAST * LB_chars = builder.createOr(LF_VT_FF_CR, NEL_LS_PS);
    7476    PabloAST * UnicodeLineBreak = builder.createAnd(LB_chars, builder.createNot(crlf));  // count the CR, but not CRLF
    75    
     77
    7678    PabloAST * lb = UNICODE_LINE_BREAK ? UnicodeLineBreak : LF;
    7779    PabloAST * unterminatedLineAtEOF = builder.createAtEOF(builder.createAdvance(builder.createNot(LB_chars), 1));
     
    7981    PabloAST * const r = builder.createExtract(getOutput(0), builder.getInteger(0));
    8082    builder.createAssign(r, LineBreak);
     83    setLookAhead(1);
    8184}
Note: See TracChangeset for help on using the changeset viewer.