Changeset 4409 for icGREP/icgrep-devel


Ignore:
Timestamp:
Jan 6, 2015, 8:26:16 PM (5 years ago)
Author:
cameron
Message:

Revise logic of word boundary tests

File:
1 edited

Legend:

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

    r4405 r4409  
    385385RE * makeWordBoundary () {
    386386    RE * wordC = makeWordSet();
    387     std::vector<RE *> alts = {makeIntersect(makeLookAheadAssertion(wordC), makeNegativeLookBehindAssertion(wordC)),
    388         makeIntersect(makeNegativeLookAheadAssertion(wordC), makeLookBehindAssertion(wordC))};
    389     return makeAlt(alts.begin(), alts.end());
     387    return makeAlt({makeSeq({makeNegativeLookBehindAssertion(wordC), makeLookAheadAssertion(wordC)}),
     388                    makeSeq({makeLookBehindAssertion(wordC), makeNegativeLookAheadAssertion(wordC)})});
    390389}
    391390
    392391RE * makeWordNonBoundary () {
    393392    RE * wordC = makeWordSet();
    394     std::vector<RE *> alts = {makeIntersect(makeLookAheadAssertion(wordC), makeLookBehindAssertion(wordC)),
    395         makeIntersect(makeNegativeLookAheadAssertion(wordC), makeNegativeLookBehindAssertion(wordC))};
    396     return makeAlt(alts.begin(), alts.end());
     393    return makeAlt({makeSeq({makeNegativeLookBehindAssertion(wordC), makeNegativeLookAheadAssertion(wordC)}),
     394                    makeSeq({makeLookBehindAssertion(wordC), makeLookAheadAssertion(wordC)})});
    397395}
    398396
Note: See TracChangeset for help on using the changeset viewer.