We should be able to run the regex engine directly from the ISequence and use checkpoints to backtrack instead of indices and consumed counts.
At each loop iteration in the Test() method we should take the checkpoint, so that we can backtrack there after every failed attempt, or store the checkpoint in a BacktrackState to rewind to. Then we can get rid of the SequenceBuffer stuff entirely and hopefully simplify a few method signatures.
We should be able to run the regex engine directly from the ISequence and use checkpoints to backtrack instead of indices and consumed counts.
At each loop iteration in the
Test()
method we should take the checkpoint, so that we can backtrack there after every failed attempt, or store the checkpoint in a BacktrackState to rewind to. Then we can get rid of theSequenceBuffer
stuff entirely and hopefully simplify a few method signatures.