Ignore:
Timestamp:
Dec 16, 2017, 12:51:48 PM (13 months ago)
Author:
cameron
Message:

Decouple Unicode property support from re_compiler; initial support for (?-m) flag

File:
1 edited

Legend:

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

    r5772 r5786  
    7474RE_Parser::RE_Parser(const std::string & regular_expression)
    7575: fByteMode(false)
    76 , fModeFlagSet(0)
     76, fModeFlagSet(MULTILINE_MODE_FLAG)
    7777, fNested(false)
    7878, mGroupsOpen(0)
     
    143143            case '^':
    144144                ++mCursor;
     145                if ((fModeFlagSet & ModeFlagType::MULTILINE_MODE_FLAG) == 0) {
     146                    return makeZeroWidth("^s");  //single-line mode
     147                }
    145148                if ((fModeFlagSet & ModeFlagType::UNIX_LINES_MODE_FLAG) != 0) {
    146149                    return makeNegativeLookBehindAssertion(makeByte(makeCC(makeCC(0, '\n'-1), makeCC('\n'+1, 0xFF))));
     
    149152            case '$':
    150153                ++mCursor;
     154                if ((fModeFlagSet & ModeFlagType::MULTILINE_MODE_FLAG) == 0) {
     155                    return makeZeroWidth("$s");  //single-line mode
     156                }
    151157                if ((fModeFlagSet & ModeFlagType::UNIX_LINES_MODE_FLAG) != 0) {
    152158                    return makeLookAheadAssertion(makeCC('\n'));
Note: See TracChangeset for help on using the changeset viewer.