Changeset 5796


Ignore:
Timestamp:
Dec 21, 2017, 4:57:36 PM (12 months ago)
Author:
cameron
Message:

Alphabet fixes

Location:
icGREP/icgrep-devel/icgrep
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/cc/alphabet.cpp

    r5795 r5796  
    3535    Alphabet(alphabetName), mCodeUnitBits(bits) {}
    3636
     37const UnicodeMappableAlphabet Unicode("Unicode", UCD::UNICODE_MAX, {});
     38
     39const UnicodeMappableAlphabet ASCII("ASCII", 0x7F, {});
     40
     41const UnicodeMappableAlphabet ISO_Latin1("ISO_Latin1", 0xFF, {});
     42
     43const CodeUnitAlphabet Byte("Byte", 8);
     44
    3745}
  • icGREP/icgrep-devel/icgrep/cc/alphabet.h

    r5795 r5796  
    6464//  Some important alphabets are predefined.
    6565
    66 const static UnicodeMappableAlphabet Unicode("Unicode", UCD::UNICODE_MAX, {});
     66const extern UnicodeMappableAlphabet Unicode;
    6767
    68 const static UnicodeMappableAlphabet ASCII("ASCII", 0x7F, {});
     68const extern UnicodeMappableAlphabet ASCII;
    6969
    70 const static UnicodeMappableAlphabet ISO_Latin1("ISO_Latin1", 0xFF, {});
     70const extern UnicodeMappableAlphabet ISO_Latin1;
    7171
    72 const static CodeUnitAlphabet Byte("Byte", 8);
     72const extern CodeUnitAlphabet Byte;
    7373
    7474}
  • icGREP/icgrep-devel/icgrep/re/grapheme_clusters.cpp

    r5787 r5796  
    1313#include <re/re_start.h>
    1414#include <re/re_end.h>
     15#include <re/re_range.h>
    1516#include <re/printer_re.h>
    1617#include <vector>                  // for vector, allocator
     
    7475        else return re;
    7576    }
    76     else if (isa<CC>(re)) {
     77    else if (isa<CC>(re) || isa<Range>(re)) {
    7778        if (inGraphemeMode) return makeSeq({re, makeZeroWidth("\\b{g}")});
    7879        else return re;
  • icGREP/icgrep-devel/icgrep/re/re_collect_unicodesets.cpp

    r5772 r5796  
    1010#include <re/re_intersect.h>
    1111#include <re/re_assertion.h>
     12#include <cc/alphabet.h>
    1213#include <boost/container/flat_set.hpp>
    13 
     14#include <llvm/Support/raw_ostream.h>
    1415
    1516using namespace llvm;
     
    2829    if (Visited.insert(re).second) {
    2930        if (CC * cc = dyn_cast<CC>(re)) {
    30             UnicodeSets.push_back(cc);
     31            if (cc->getAlphabet() == &cc::Unicode) {
     32                UnicodeSets.push_back(cc);
     33            }
    3134        } else if (isa<Name>(re)) {
    3235            auto def = cast<Name>(re)->getDefinition();
Note: See TracChangeset for help on using the changeset viewer.