Ignore:
Timestamp:
Dec 9, 2017, 4:37:51 PM (22 months ago)
Author:
cameron
Message:

Restructure to eliminate unnecessary dependencies on RegExpCompiler? and UCDLIB

Location:
icGREP/icgrep-devel/icgrep/UCD
Files:
3 edited

Legend:

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

    r5748 r5770  
    77
    88#include "CaseFolding.h"
     9#include <UCD/unicode_set.h>
    910#include <algorithm>
    1011
     
    7374    }
    7475}
     76inline codepoint_t lo_codepoint(const interval_t & i) {
     77    return std::get<0>(i);
     78}
     79
     80inline codepoint_t hi_codepoint(const interval_t & i) {
     81    return std::get<1>(i);
     82}
     83
     84UnicodeSet * caseInsensitize(UnicodeSet * const cc) {
     85    UnicodeSet * cci = new UnicodeSet();
     86    for (const interval_t i : *cc) {
     87        caseInsensitiveInsertRange(cci, lo_codepoint(i), hi_codepoint(i));
     88    }
     89    return cci;
     90}
    7591
    7692
  • icGREP/icgrep-devel/icgrep/UCD/CaseFolding.h

    r5751 r5770  
    2121};
    2222
    23 void caseInsensitiveInsertRange(UCD::UnicodeSet * const cc, const UCD::codepoint_t lo, const UCD::codepoint_t hi);
    24 
    25 inline void caseInsensitiveInsert(UCD::UnicodeSet * const cc, const UCD::codepoint_t cp) {
    26     caseInsensitiveInsertRange(cc, cp, cp);
    27 }
     23UCD::UnicodeSet * caseInsensitize(UCD::UnicodeSet * const cc);
     24
    2825
    2926const int foldTableSize = 246;
  • icGREP/icgrep-devel/icgrep/UCD/resolve_properties.cpp

    r5747 r5770  
    44 *  icgrep is a trademark of International Characters.
    55 */
     6#include <re/re_re.h>
    67#include "resolve_properties.h"
    78#include <re/re_alt.h>
     
    3132void UnicodePropertyExpressionError(std::string errmsg) {
    3233    llvm::report_fatal_error(errmsg);
    33 
    34 }
    35 
     34}
     35
     36#define Behind(x) makeLookBehindAssertion(x)
     37#define Ahead(x) makeLookAheadAssertion(x)
    3638
    3739void generateGraphemeClusterBoundaryRule(Name * const &property) {
    3840    // 3.1.1 Grapheme Cluster Boundary Rules
    39 #define Behind(x) makeLookBehindAssertion(x)
    40 #define Ahead(x) makeLookAheadAssertion(x)
    4141
    4242//    RE * GCB_Control = makeName("gcb", "cn", Name::Type::UnicodeProperty);
Note: See TracChangeset for help on using the changeset viewer.