Changeset 4339 for icGREP/icgrep-devel


Ignore:
Timestamp:
Dec 13, 2014, 8:14:53 PM (5 years ago)
Author:
cameron
Message:

Use hex in canonical names

File:
1 edited

Legend:

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

    r4337 r4339  
    88#include <llvm/Support/Compiler.h>
    99#include <UCD/CaseFolding_txt.h>
     10#include <sstream>
    1011
    1112namespace re {
     
    2627
    2728std::string CC::canonicalName(CC_type t) const {
    28     std::string name = "CC";
     29    std::stringstream name;
     30    name << std::hex;
    2931    if ((t == ByteClass) && (mSparseCharSet.back().hi_codepoint >= 0x80)) {
    30       name = "BC";
    31     }
     32      name << "BC";
     33    }
     34    else name << "CC";
    3235    char separator = '_';
    3336    for (const CharSetItem & i : mSparseCharSet) {
    34         name += separator;
     37        name << separator;
    3538        if (i.lo_codepoint == i.hi_codepoint) {
    36             name += std::to_string(i.lo_codepoint);
     39            name << i.lo_codepoint;
    3740        }
    3841        else {
    39             name += std::to_string(i.lo_codepoint) + "-" + std::to_string(i.hi_codepoint);
     42            name << i.lo_codepoint << "-" << i.hi_codepoint;
    4043        }
    4144        separator = ',';
    4245    }
    43     return name;
     46    return name.str();
    4447}
    4548
Note: See TracChangeset for help on using the changeset viewer.