Thompson NFA regex engine doesn’t advance stream position when matching #258
Labels
bug
Something isn't working
fixed-in-110.99.4
issues that will be fixed in the 110.99.4 version
regexp-lib
problem with Regular Expression library
Version
Pre-110.97
Operating System
OS Version
Debian 11.5 (“bullseye”)
Processor
System Component
SML/NJ Library
Severity
Minor
Description
Unlike the backtracking and DFA-based regular expression engines, the engine based on the Thompson NFA construction (
ThompsonEngine
) does not advance the stream cursor when matching. That is, the example code I’ve provided in this bug report printsTranscript
No response
Expected Behavior
The Thompson engine should exhibit the same behavior as the other regex engines. That is, the example code I’ve provided in this bug report should produce
Steps to Reproduce
thompson.sml:
thompson.cm:
Additional Information
Although I’m running an old version of SML/NJ, I’ve verified that this behavior persists with the latest thompson-engine.sml.
Email address
bbarenblat@gmail.com
The text was updated successfully, but these errors were encountered: