Ignore:
Timestamp:
Dec 24, 2017, 3:00:40 PM (16 months ago)
Author:
cameron
Message:

Correction for nullable assertions; clean-up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_assertion.h

    r5725 r5806  
    1111#include <re/re_nullable.h>
    1212#include <re/re_seq.h>
     13#include <re/re_alt.h>
    1314
    1415namespace re {
     
    5455
    5556inline RE * makeAssertion(RE * asserted, Assertion::Kind k, Assertion::Sense s) {
    56     if (RE_Nullable::isNullable(asserted)) return makeSeq();
     57    if (RE_Nullable::isNullable(asserted)) {
     58        if (k == Assertion::Kind::Boundary) {
     59            if (s == Assertion::Sense::Positive) return makeAlt();
     60            else return makeSeq();
     61        }
     62        if (s == Assertion::Sense::Positive) return makeSeq();
     63        else return makeAlt();
     64    }
    5765    return new Assertion(asserted, k, s);
    5866}
Note: See TracChangeset for help on using the changeset viewer.