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
1 changed files with 4 additions and 3 deletions

View File

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