Whiteknight / ParserObjects

C# library for parser combinators
https://whiteknight.github.io/ParserObjects
Apache License 2.0
6 stars 0 forks source link

Regex should not buffer input #166

Closed Whiteknight closed 1 year ago

Whiteknight commented 1 year ago

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.

Whiteknight commented 1 year ago

This is done in the v5 branch now. Regex needs more testing overall, but this is pretty solid