Ignore:
Timestamp:
Jul 14, 2015, 10:46:10 PM (4 years ago)
Author:
nmedfort
Message:

Moved responsibility of handling 'special cases of Unicode TR #18' and 'compatibility properties of UTR #18 Annex C' into RE_Parser.

File:
1 edited

Legend:

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

    r4661 r4671  
    132132            }
    133133        }
    134         // Now try special cases of Unicode TR #18
    135         else if (value == "any") {
    136             name->setDefinition(makeAny());
    137         }
    138         else if (value == "assigned") {
    139             Name * Cn = makeName("Cn", Name::Type::UnicodeProperty);
    140             name->setDefinition(makeDiff(makeAny(), Cn));
    141         }
    142         else if (value == "ascii") {
    143             name->setFunctionName("__get_blk_ASCII");
    144         }
    145         // Now compatibility properties of UTR #18 Annex C
    146         else if (value == "xdigit") {
    147             Name * Nd = makeName("Nd", Name::Type::UnicodeProperty);
    148             Name * hexdigit = makeName("Hex_digit", Name::Type::UnicodeProperty);
    149             name->setDefinition(makeAlt({Nd, hexdigit}));
    150         }
    151         else if (value == "alnum") {
    152             Name * digit = makeName("Nd", Name::Type::UnicodeProperty);
    153             Name * alpha = makeName("alphabetic", Name::Type::UnicodeProperty);
    154             name->setDefinition(makeAlt({digit, alpha}));
    155         }
    156         else if (value == "blank") {
    157             Name * space_sep = makeName("space_separator", Name::Type::UnicodeProperty);
    158             CC * tab = makeCC(0x09);
    159             name->setDefinition(makeAlt({space_sep, tab}));
    160         }
    161         else if (value == "graph") {
    162             Name * space = makeName("space", Name::Type::UnicodeProperty);
    163             Name * ctrl = makeName("control", Name::Type::UnicodeProperty);
    164             Name * surr = makeName("surrogate", Name::Type::UnicodeProperty);
    165             Name * unassigned = makeName("Cn", Name::Type::UnicodeProperty);
    166             Name * nongraph = makeName("[^graph]", Name::Type::UnicodeProperty);
    167             nongraph->setDefinition(makeAlt({space, ctrl, surr, unassigned}));
    168             name->setDefinition(makeDiff(makeAny(), nongraph));
    169         }
    170         else if (value == "print") {
    171             Name * graph = makeName("graph", Name::Type::UnicodeProperty);
    172             Name * space_sep = makeName("space_separator", Name::Type::UnicodeProperty);
    173             name->setDefinition(makeAlt({graph, space_sep}));
    174         }
    175         else if (value == "word") {
    176             Name * alnum = makeName("alnum", Name::Type::UnicodeProperty);
    177             Name * mark = makeName("mark", Name::Type::UnicodeProperty);
    178             Name * conn = makeName("Connector_Punctuation", Name::Type::UnicodeProperty);
    179             Name * join = makeName("Join_Control", Name::Type::UnicodeProperty);
    180             name->setDefinition(makeAlt({alnum, mark, conn, join}));
    181         }
    182134        else {
    183135            throw UnicodePropertyExpressionError("Expected a general category, script or binary property name, but '" + name->getName() + "' found instead");
Note: See TracChangeset for help on using the changeset viewer.