Ignore:
Timestamp:
Mar 10, 2018, 11:44:44 AM (17 months ago)
Author:
cameron
Message:

RE compiler restructuring progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep/grep_engine.cpp

    r5894 r5897  
    7777    pattern = resolveCaseInsensitiveMode(pattern, false);
    7878    pattern = regular_expression_passes(pattern);
    79    
    80    
     79    pattern = re::exclude_CC(pattern, re::makeByte(0x0A));
     80    pattern = resolveAnchors(pattern, re::makeByte(0x0A));
     81
    8182    ParabixDriver pxDriver("codepointEngine");
    8283    auto & idb = pxDriver.getBuilder();
     
    214215    if (mGrepRecordBreak == GrepRecordBreakKind::Unicode) {
    215216        breakCC = re::makeCC(re::makeCC(0x0A, 0x0D), re::makeCC(re::makeCC(0x85), re::makeCC(0x2028, 0x2029)));
    216         breakName = "UTF8_LB";
    217217    } else if (mGrepRecordBreak == GrepRecordBreakKind::Null) {
    218218        breakCC = re::makeByte(0);  // Null
    219         breakName = "NULL";
    220219    } else {
    221220        breakCC = re::makeByte(0x0A); // LF
    222         breakName = "LF";
     221    }
     222    re::RE * anchorRE = breakCC;
     223    if (mGrepRecordBreak == GrepRecordBreakKind::Unicode) {
     224        re::Name * anchorName = re::makeName("UTF8_LB", re::Name::Type::Unicode);
     225        anchorName->setDefinition(UCD::UnicodeBreakRE());
     226        anchorRE = anchorName;
    223227    }
    224228
     
    226230        REs[i] = resolveModesAndExternalSymbols(REs[i]);
    227231        REs[i] = re::exclude_CC(REs[i], breakCC);
    228         if (mGrepRecordBreak != GrepRecordBreakKind::Unicode) {
    229             REs[i] = resolveAnchors(REs[i], breakCC);
    230         }
     232        REs[i] = resolveAnchors(REs[i], anchorRE);
    231233        re::gatherUnicodeProperties(REs[i], UnicodeProperties);
    232234        REs[i] = regular_expression_passes(REs[i]);
Note: See TracChangeset for help on using the changeset viewer.