Changeset 6283


Ignore:
Timestamp:
Jan 19, 2019, 2:44:49 PM (3 months ago)
Author:
cameron
Message:

Simplification of assertions within assertions.

File:
1 edited

Legend:

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

    r6282 r6283  
    313313            for (auto i = seq->rbegin(); i != seq->rend(); ++i) {
    314314                working = ctxt_match(*i, kind, working);
     315                //errs() << "*i: " << Printer_RE::PrintRE(*i) << "\n";
     316                //errs() << "working.rslt: " << Printer_RE::PrintRE(working.rslt) << "\n";
    315317                if (isEmptySet(working.rslt)) return working;
    316318            }
     
    367369        if (a->getKind() == kind) {
    368370            ContextMatchCursor assertResult = ctxt_match(a->getAsserted(), kind, cursor);
    369             if (!isEmptySet(assertResult.rslt)) return ContextMatchCursor{cursor.ctxt, re};
    370             if (isEmptySeq(assertResult.rslt) == (a->getSense() == Assertion::Sense::Positive)) {
    371                 return ContextMatchCursor{cursor.ctxt, makeSeq()};
    372             }
    373             return ContextMatchCursor{cursor.ctxt, makeAlt()};
     371            return ContextMatchCursor{cursor.ctxt, makeAssertion(assertResult.rslt, kind, a->getSense())};
    374372        }
    375373        return ContextMatchCursor{cursor.ctxt, re};
Note: See TracChangeset for help on using the changeset viewer.