Changeset 5754 for icGREP


Ignore:
Timestamp:
Dec 2, 2017, 6:39:08 PM (16 months ago)
Author:
cameron
Message:

Fixes for last check-in

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

Legend:

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

    r5753 r5754  
    1212namespace re {
    1313
    14 RE * FixedStringParser::parse_alt() {
    15     std::vector<RE *> alt;
    16     do {
    17         alt.push_back(parse_seq());
    18     }
    19     while (mCursor.more() && (*mCursor == '\n'));
    20     return makeAlt(alt.begin(), alt.end());
     14bool FixedStringParser::accept_alt_mark() {
     15    if (!mCursor.more() || (*mCursor != '\n')) return false;
     16    mCursor++;
     17    return true;
    2118}
    2219
  • icGREP/icgrep-devel/icgrep/re/parse_fixed_strings.h

    r5753 r5754  
    1515            mReSyntax = RE_Syntax::FixedStrings;
    1616        }
    17         RE * parse_alt () override;
     17        bool accept_alt_mark () override;
    1818        RE * parse_seq () override;
    1919    };
  • icGREP/icgrep-devel/icgrep/re/re_parser.cpp

    r5753 r5754  
    105105        alt.push_back(parse_seq());
    106106    }
    107     while (mCursor.more() && (*mCursor == '|'));
     107    while (accept_alt_mark());
    108108    return makeAlt(alt.begin(), alt.end());
     109}
     110   
     111bool RE_Parser::accept_alt_mark() {
     112    if (!mCursor.more() || (*mCursor != '|')) return false;
     113    mCursor++;
     114    return true;
    109115}
    110116
  • icGREP/icgrep-devel/icgrep/re/re_parser.h

    r5752 r5754  
    111111
    112112    virtual RE * parse_alt();
    113 
     113   
     114    virtual bool accept_alt_mark();
     115   
    114116    virtual RE * parse_seq();
    115117
Note: See TracChangeset for help on using the changeset viewer.