if (nfa->flags & HASLACONS)
fprintf(f, ", haslacons");
if (nfa->flags & MATCHALL)
- fprintf(f, ", minmatchall %d, maxmatchall %d",
- nfa->minmatchall, nfa->maxmatchall);
+ {
+ fprintf(f, ", minmatchall %d", nfa->minmatchall);
+ if (nfa->maxmatchall == DUPINF)
+ fprintf(f, ", maxmatchall inf");
+ else
+ fprintf(f, ", maxmatchall %d", nfa->maxmatchall);
+ }
fprintf(f, "\n");
for (s = nfa->states; s != NULL; s = s->next)
{
if (cnfa->flags & HASLACONS)
fprintf(f, ", haslacons");
if (cnfa->flags & MATCHALL)
- fprintf(f, ", minmatchall %d, maxmatchall %d",
- cnfa->minmatchall, cnfa->maxmatchall);
+ {
+ fprintf(f, ", minmatchall %d", cnfa->minmatchall);
+ if (cnfa->maxmatchall == DUPINF)
+ fprintf(f, ", maxmatchall inf");
+ else
+ fprintf(f, ", maxmatchall %d", cnfa->maxmatchall);
+ }
fprintf(f, "\n");
for (st = 0; st < cnfa->nstates; st++)
dumpcstate(st, cnfa, f);
/* and ^* and \A* too -- not always necessary, but harmless */
newarc(nfa, PLAIN, nfa->bos[0], pre, pre);
newarc(nfa, PLAIN, nfa->bos[1], pre, pre);
+
+ /*
+ * The pattern is still MATCHALL if it was before, but the max match
+ * length is now infinity.
+ */
+ if (nfa->flags & MATCHALL)
+ nfa->maxmatchall = DUPINF;
}
/*
{
size_t nchr = probe - v->start;
- /*
- * It might seem that we should check maxmatchall too, but the .* at
- * the front of the pattern absorbs any extra characters (and it was
- * tacked on *after* computing minmatchall/maxmatchall). Thus, we
- * should match if there are at least minmatchall characters.
- */
if (nchr < d->cnfa->minmatchall)
return 0;
+ /* maxmatchall will always be infinity, cf. makesearch() */
+ assert(d->cnfa->maxmatchall == DUPINF);
return 1;
}