Ignore:
Timestamp:
Nov 7, 2016, 3:54:09 PM (3 years ago)
Author:
xwa163
Message:
  1. Extend Regex Syntax, include: (a) RL2.6 of UTS#18, support regex in property value. e.g. \p{script=/.*hir.*/} (b) Support syntax of property expression when parsing boundary. e.g. \b{greek} (c) Extend property expression in non capture group. e.g. (?\p{upper}:\p{greek}\p{script=hira})
  2. Add related test cases
File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/resolve_properties.cpp

    r5091 r5206  
    220220}
    221221
     222const std::string& getPropertyValueGrepString(const std::string & prop) {
     223    auto propName = canonicalize_value_name(prop);
     224    auto propit = alias_map.find(propName);
     225    if (propit == alias_map.end()) {
     226        throw UnicodePropertyExpressionError("Expected a property name, but '" + prop + "' found instead");
     227    }
     228    auto theprop = propit->second;
     229    if (EnumeratedPropertyObject * p = dyn_cast<EnumeratedPropertyObject>(property_object_table[theprop])){
     230        return p->GetPropertyValueGrepString();
     231    } else if (BinaryPropertyObject * p = dyn_cast<BinaryPropertyObject>(property_object_table[theprop])) {
     232        return p->GetPropertyValueGrepString();
     233    }
     234
     235    throw UnicodePropertyExpressionError("Property " + property_full_name[theprop] + " recognized but not supported in icgrep 1.0");
     236}
     237
    222238UnicodeSet resolveUnicodeSet(Name * const name) {
    223239    if (name->getType() == Name::Type::UnicodeProperty) {
Note: See TracChangeset for help on using the changeset viewer.