Changeset 5802


Ignore:
Timestamp:
Dec 24, 2017, 6:03:30 AM (9 months ago)
Author:
cameron
Message:

Allow RE compiler to handle any Unicode CCs not previously translated

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

Legend:

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

    r5801 r5802  
    2727#include <re/re_start.h>
    2828#include <re/re_local.h>
     29#include <re/to_utf8.h>
    2930#include <re/re_toolchain.h>        // for AlgorithmOptionIsSet, RE_Algorith...
    3031#include "cc/cc_compiler.h"         // for CC_Compiler
     
    8687
    8788MarkerType RE_Compiler::compileCC(CC * cc, MarkerType marker, PabloBuilder & pb) {
     89    // If Unicode CCs weren't pulled out earlier, we generate the equivalent
     90    // byte sequence as an RE.
     91    if (cc->getAlphabet() == &cc::Unicode) return process(toUTF8(cc), marker, pb);
    8892    PabloAST * nextPos = markerVar(marker);
    8993    if (isByteLength(cc)) {
  • icGREP/icgrep-devel/icgrep/re/re_name_resolve.cpp

    r5786 r5802  
    1414#include <re/re_memoizer.hpp>
    1515#include <UCD/resolve_properties.h>
     16#include <cc/alphabet.h>
    1617#include <boost/container/flat_set.hpp>
    1718#include <sstream>
     
    4243                        name->setDefinition(resolveUnicodeProperties(name->getDefinition()));
    4344                    } else {
    44                         name->setDefinition(makeCC(UCD::resolveUnicodeSet(name)));
     45                        name->setDefinition(makeCC(UCD::resolveUnicodeSet(name), &cc::Unicode));
    4546                    }
    4647                } else {
  • icGREP/icgrep-devel/icgrep/re/to_utf8.cpp

    r5798 r5802  
    5454    const auto max_lgth = UTF<8>::encoded_length(hi);
    5555    if (min_lgth < max_lgth) {
    56         const auto m = UTF<8>::max_codepoint_of_length(lo);
     56        const auto m = UTF<8>::max_codepoint_of_length(min_lgth);
    5757        return makeAlt({rangeToUTF8(lo, m), rangeToUTF8(m + 1, hi)});
    5858    }
Note: See TracChangeset for help on using the changeset viewer.