Ignore:
Timestamp:
Jul 4, 2016, 8:54:48 PM (3 years ago)
Author:
cameron
Message:

Initial support for capture groups/back references; back reference simply repeats regexp

File:
1 edited

Legend:

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

    r5063 r5080  
    453453
    454454inline MarkerType RE_Compiler::compileName(Name * name, MarkerType marker, PabloBuilder & pb) {
    455     MarkerType nameMarker = compileName(name, pb);
    456     MarkerType nextPos;
    457     if (markerPos(marker) == MarkerPosition::FinalPostPositionUnit) {
    458         nextPos = marker;
    459     } else if (name->getType() == Name::Type::Byte) {
    460         nextPos = AdvanceMarker(marker, MarkerPosition::InitialPostPositionUnit, pb);
    461     } else {
    462         nextPos = AdvanceMarker(marker, MarkerPosition::FinalPostPositionUnit, pb);
    463     }
    464     nameMarker.stream = pb.createAnd(markerVar(nextPos), markerVar(nameMarker), name->getName());
    465     return nameMarker;
     455    if (isUnicodeUnitLength(name)) {
     456        MarkerType nameMarker = compileName(name, pb);
     457        MarkerType nextPos;
     458        if (markerPos(marker) == MarkerPosition::FinalPostPositionUnit) {
     459            nextPos = marker;
     460        } else if (name->getType() == Name::Type::Byte) {
     461            nextPos = AdvanceMarker(marker, MarkerPosition::InitialPostPositionUnit, pb);
     462        } else {
     463            nextPos = AdvanceMarker(marker, MarkerPosition::FinalPostPositionUnit, pb);
     464        }
     465        nameMarker.stream = pb.createAnd(markerVar(nextPos), markerVar(nameMarker), name->getName());
     466        return nameMarker;
     467    }
     468    else {
     469        return process(name->getDefinition(), marker, pb);
     470    }
    466471}
    467472
Note: See TracChangeset for help on using the changeset viewer.