Ignore:
Timestamp:
Oct 17, 2015, 4:25:05 PM (4 years ago)
Author:
nmedfort
Message:

Update for grapheme cluster mode and boundaries.

File:
1 edited

Legend:

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

    r4835 r4841  
    6363        // Eventually names might be set up for not unit length items.
    6464        return (n->getType() == Name::Type::Unicode || n->getType() == Name::Type::UnicodeProperty || n->getType() == Name::Type::Byte);
    65     } else if (const GraphemeBoundary * gb = dyn_cast<GraphemeBoundary>(re)) {
    66         return isUnicodeUnitLength(gb->getExpression());
    6765    }
    6866    return false; // otherwise
     
    127125                return std::make_pair(0, std::numeric_limits<int>::max());
    128126        }
    129     } else if (const GraphemeBoundary * gb = dyn_cast<GraphemeBoundary>(re)) {
    130         return std::make_pair(getUnicodeUnitLengthRange(gb->getExpression()).first, std::numeric_limits<int>::max());
     127    } else if (const GraphemeBoundary * gp = dyn_cast<GraphemeBoundary>(re)) {
     128        if (gp->getExpression()) {
     129            return getUnicodeUnitLengthRange(gp->getExpression());
     130        }
     131        return std::make_pair(0, 0);
    131132    }
    132133    return std::make_pair(1, 1);
Note: See TracChangeset for help on using the changeset viewer.