Version 1.14 of VitRegex is released:
- in analyseFirstCharSet, the test for "of 81" ('Q') was lumped in with
simple zero-width tokens that just need tokenPos += 1. But 'Q' assertions
have a body that extends to its linkIndex. So just incrementing tokenPos by
one walked INTO the assertion content, not past it, causing the first
character of the assertion's body to be mistakenly used as the first char
of the branch. Kudos to Claude for noticing this bug. It was introduced
in vers 1.04 and had been hiding in plain sight since then. (I've now
added specific tests for this to guard against any future regression).
- in yesterday's Version 1.13 in the new "of 71 code",
self.scanForAlternation(tokenPos + 1) was not bounded by (closingPos - 1)
and could therefore potentially find an outer | and take the "alternating
group" path for a non-alternating group like "(cat)" in "(cat)|dog".
- note this did *not* create a bug as the alternating path has
getNextAlt(x, closingPos) properly bounded so it was ultimately handled
correctly, if somewhat serendipidously rather than by design. You gotta
get lucky some times <g>. Still, I decided it was better to "do it right"
so have added an extra parameter, pEndPos, to scanForAlternation.
So:
scanForAlternation Procedure(long pStartPos), bool
is now
scanForAlternation Procedure(long pStartPos, long pEndPos=0), bool
so when pEndPos is zero (the default when not supplied), which is the case
when currently called from analyseLiteralPrefix, analyseFirstCharSet (the
non-"of 71" paths) and findPos, it will continue to scan to the end of
the pattern as before.