Fixed inverted group thrown off by quantifiers

This commit is contained in:
Zher Huei Lee 2017-06-26 15:25:10 +08:00
parent 382db0898e
commit f01ce3276e

View file

@ -603,10 +603,8 @@ struct RegExNodeGroup : public RegExNode {
int res = childset[i]->test(s, pos); int res = childset[i]->test(s, pos);
if (s.complete)
return res;
if (inverse) { if (inverse) {
s.complete = false;
if (res < 0) if (res < 0)
res = pos + 1; res = pos + 1;
else else
@ -616,6 +614,9 @@ struct RegExNodeGroup : public RegExNode {
continue; continue;
} }
if (s.complete)
return res;
if (res >= 0) { if (res >= 0) {
if (reset_pos) if (reset_pos)
res = pos; res = pos;