Changeset 5593


Ignore:
Timestamp:
Aug 3, 2017, 1:03:36 PM (4 months ago)
Author:
nmedfort
Message:

Bug fix for RE_Compiler.

File:
1 edited

Legend:

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

    r5585 r5593  
    4545    Name * ZeroWidth = nullptr;
    4646    mCompiledName = &mBaseMap;
    47 
    48     auto nameMap = gatherNames(re, ZeroWidth);
    49 
     47    gatherNames(re, ZeroWidth);
    5048    // Now precompile any grapheme segmentation rules
    5149    if (ZeroWidth) {
     
    352350    Var * m = pb.createVar("m", pb.createZeroes());
    353351    PabloBuilder nested = PabloBuilder::Create(pb);
     352    NameMap nestedMap(mCompiledName);
     353    mCompiledName = &nestedMap;
    354354    MarkerType m1 = processLowerBound(repeated, lb - group, marker, ifGroupSize * 2, nested);
    355355    nested.createAssign(m, markerVar(m1));
    356356    pb.createIf(markerVar(marker), nested);
     357    mCompiledName = nestedMap.getParent();
    357358    return makeMarker(m1.pos, m);
    358359}
     
    387388    Var * m1a = pb.createVar("m", pb.createZeroes());
    388389    PabloBuilder nested = PabloBuilder::Create(pb);
     390    NameMap nestedMap(mCompiledName);
     391    mCompiledName = &nestedMap;
    389392    MarkerType m1 = processBoundedRep(repeated, ub - group, marker, ifGroupSize * 2, nested);
    390393    nested.createAssign(m1a, markerVar(m1));
    391394    pb.createIf(markerVar(marker), nested);
     395    mCompiledName = nestedMap.getParent();
    392396    return makeMarker(m1.pos, m1a);
    393397}
     
    436440        mWhileTest = pb.createZeroes();
    437441        PabloBuilder wb = PabloBuilder::Create(pb);
     442        NameMap nestedMap(mCompiledName);
     443        mCompiledName = &nestedMap;
    438444        mStarDepth++;
    439445        MarkerType result = process(repeated, makeMarker(MarkerPosition::FinalPostPositionUnit, whilePending), wb);
     
    445451        pb.createWhile(whileTest, wb);
    446452        mStarDepth--;
     453        mCompiledName = nestedMap.getParent();
    447454        return makeMarker(markerPos(result), whileAccum);
    448455    }
Note: See TracChangeset for help on using the changeset viewer.