Ignore:
Timestamp:
Dec 8, 2017, 8:20:54 PM (19 months ago)
Author:
cameron
Message:

Regular expression group nodes; case-insensitive logic

File:
1 edited

Legend:

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

    r5763 r5765  
    44#include <re/re_seq.h>
    55#include <re/re_rep.h>
     6#include <re/re_group.h>
    67#include <re/re_range.h>
    78#include <re/re_diff.h>
     
    6364}
    6465
     66inline bool lessThan(const Group * const lh, const Group * const rh) {
     67    if (lh->getMode() != rh->getMode()) {
     68        return lh->getMode() < rh->getMode();
     69    }
     70    if (lh->getSense() != rh->getSense()) {
     71        return lh->getSense() < rh->getSense();
     72    }
     73    return compare(lh->getRE(), rh->getRE());
     74}
     75
    6576inline bool compare(const RE * const lh, const RE * const rh) {
    6677    using Type = RE::ClassTypeId;
     
    90101        case Type::Name:
    91102            return *cast<Name>(lh) < *cast<Name>(rh);
     103        case Type::Group:
     104            return lessThan(cast<Group>(lh), cast<Group>(rh));
    92105        case Type::Range:
    93106            return lessThan(cast<Range>(lh), cast<Range>(rh));
Note: See TracChangeset for help on using the changeset viewer.