Ignore:
Timestamp:
Oct 21, 2014, 1:03:34 PM (5 years ago)
Author:
cameron
Message:

Remove the negated attribute for unicode categories; use Diff(any, cat)

File:
1 edited

Legend:

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

    r4255 r4256  
    191191    ++_cursor;
    192192    throw_incomplete_expression_error_if_end_of_stream();
    193     bool negated = false;
    194193    switch (*_cursor) {
    195194        case '(': case ')': case '*': case '+':
     
    200199            return makeCC(parse_hex());
    201200        case 'P':
    202             negated = true;
     201            return makeDiff(makeAny(), parse_unicode_category());
    203202        case 'p':
    204             return parse_unicode_category(negated);
     203            return parse_unicode_category();
    205204    }
    206205    throw ParseFailure("Illegal backslash escape!");
     
    249248}
    250249
    251 inline Name * RE_Parser::parse_unicode_category(const bool negated) {
     250inline Name * RE_Parser::parse_unicode_category() {
    252251    if (++_cursor != _end && *_cursor == '{') {
    253252        const cursor_t start = _cursor + 1;
     
    261260            ++_cursor;
    262261        }
    263         return makeName(std::string(start, _cursor++), negated, Name::Type::UnicodeCategory);
     262        return makeName(std::string(start, _cursor++), Name::Type::UnicodeCategory);
    264263    }
    265264    throw ParseFailure("Incorrect Unicode character class format!");
Note: See TracChangeset for help on using the changeset viewer.