-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This enables RegexSets to short-circuit when: 1. All patterns are anchored to the beginning of the input. 2. All patterns have either matched or will never match. We make this happen by checking whether all NFA states in a DFA state are match states, when a DFA match is observed. If all NFA states are match states, and since all match states are final states, we know that the current set of matches will never change. Since we don't care about reporting location information, we can quit. N.B. If no matches can be found, then the DFA will short circuit using its normal mechanism.
- Loading branch information
1 parent
090655b
commit 445c834
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters