-
Notifications
You must be signed in to change notification settings - Fork 4
Switch to score
instead of worstCaseBacktrackCount
#637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
score
instead of worstCaseBacktracks
score
instead of worstCaseBacktrackCount
31362da
to
eb6a9bf
Compare
[/ab/, false, new Set(['missingAnchor'])], | ||
[/(a+)+/, false, new Set(['missingAnchor'])], | ||
[/a*a+/, false, new Set(['missingAnchor'])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rxrx matches anx in 7 steps.
[/ab/, false, new Set(['missingAnchor'])], | ||
[/(a+)+/, false, new Set(['missingAnchor'])], | ||
[/a*a+/, false, new Set(['missingAnchor'])], | ||
[/a*a{2,}/, false, new Set(['missingAnchor'])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rxrx matches anx in 9 steps.
[/(a+)+/, false, new Set(['missingAnchor'])], | ||
[/a*a+/, false, new Set(['missingAnchor'])], | ||
[/a*a{2,}/, false, new Set(['missingAnchor'])], | ||
[/a*aa/, false, new Set(['missingAnchor'])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto 9 steps.
[/(a+)+/, true, new Set(['missingAnchor'])], | ||
[/(a+)+$/, false, new Set(['missingAnchor'])], | ||
[/(a+)+a/, false, new Set(['missingAnchor'])], | ||
[/(a|aa)/, false, new Set(['missingAnchor'])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rxrx 6 steps.
[/a*aa/, false, new Set(['missingAnchor'])], | ||
[/(a+)+/, true, new Set(['missingAnchor'])], | ||
[/(a+)+$/, false, new Set(['missingAnchor'])], | ||
[/(a+)+a/, false, new Set(['missingAnchor'])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rxrx matches in 21 steps irrespective of n.
eb6a9bf
to
3c44e92
Compare
3c44e92
to
168581f
Compare
Switch to
score
instead ofworstCaseBacktrackCount
and fix some bugs.worstCaseBacktrackCount
wasn't always accurate if there were any unbound quantifiers given we didn't know the max length of the input string.So now there's a more abstract
score
instead.Breaking changes
Library:
maxBacktracks
config removedmaxScore
config addedworstCaseBacktrackCount
removedscore
addedhitMaxBacktracks
error removedhitMaxScore
error addedBacktrackCount
type removedScore
type addedCLI:
--maxBacktracks
removed--maxScore
addedHow is
score
calculated?1
this means no backtracks can occur and for every possible input string the pattern could only match one way.closes #624
closes #621