Ignore:
Timestamp:
Dec 18, 2017, 1:56:51 PM (11 months ago)
Author:
cameron
Message:

RE parser restructuring; parsing symbolic ranges, collation and equivalence exprs

File:
1 edited

Legend:

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

    r5772 r5787  
    3838        if (n->getType() == Name::Type::ZeroWidth) {
    3939            const std::string nameString = n->getName();
    40             return (nameString == "GCB") || (nameString == "nonGCB");
     40            return (nameString == "\\b{g}") || (nameString == "\\B{g}");
    4141        }
    42         return hasGraphemeClusterBoundary(n->getDefinition());
     42        return false;
    4343    } else if (const Alt * alt = dyn_cast<Alt>(re)) {
    4444        for (const RE * re : *alt) {
     
    7171    if (isa<Name>(re)) {
    7272        if (inGraphemeMode && (cast<Name>(re)->getName() == "."))
    73             return makeSeq({makeAny(), makeRep(makeSeq({makeZeroWidth("NonGCB"), makeAny()}), 0, Rep::UNBOUNDED_REP), makeZeroWidth("GCB")});
     73            return makeSeq({makeAny(), makeRep(makeSeq({makeZeroWidth("\\B{g}"), makeAny()}), 0, Rep::UNBOUNDED_REP), makeZeroWidth("\\b{g}")});
    7474        else return re;
    7575    }
    7676    else if (isa<CC>(re)) {
    77         if (inGraphemeMode) return makeSeq({re, makeZeroWidth("GCB")});
     77        if (inGraphemeMode) return makeSeq({re, makeZeroWidth("\\b{g}")});
    7878        else return re;
    7979    }
     
    8484            bool atSingleChar = isa<CC>(re) && (cast<CC>(re)->count() == 1);
    8585            if (afterSingleChar && inGraphemeMode && !atSingleChar)
    86                 list.push_back(makeZeroWidth("GCB"));
     86                list.push_back(makeZeroWidth("\\b{g}"));
    8787            if (isa<CC>(re)) list.push_back(*i);
    8888            else {
     
    9191            afterSingleChar = atSingleChar;
    9292        }
    93         if (afterSingleChar && inGraphemeMode) list.push_back(makeZeroWidth("GCB"));
     93        if (afterSingleChar && inGraphemeMode) list.push_back(makeZeroWidth("\\b{g}"));
    9494        return makeSeq(list.begin(), list.end());
    9595    } else if (Group * g = dyn_cast<Group>(re)) {
Note: See TracChangeset for help on using the changeset viewer.