<regex>: Some _Matcher3::Skip() cleanups#6164
Open
muellerj2 wants to merge 4 commits intomicrosoft:mainfrom
Open
<regex>: Some _Matcher3::Skip() cleanups#6164muellerj2 wants to merge 4 commits intomicrosoft:mainfrom
<regex>: Some _Matcher3::Skip() cleanups#6164muellerj2 wants to merge 4 commits intomicrosoft:mainfrom
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR performs some cleanups to
_Matcher3::_Skip()that I don't want to mix with the performance work in_Skip()to close the big gap with Boost.Regex for disjunctive regexes.Each cleanup is split into its own commit.
_First_arg=>_First: I think the local variable was named_First_argto avoid shadowing the member_Firstof_Matcher3. But this member was removed a while ago, so we can rename the local variable to the more common name_Firstnow.constis pervasive in<regex>. I have to admit I didn't really cared about this until now because there were more much important problems to solve, but we should change this especially for any pointers to NFA nodes in the matcher. This addsconstto_Skip()and applies the minimally necessary const propagation to_Do_class()._Skipsignature:_Skip()had the wrong signature: Its callers pass iterators of type_Itand all functions called internally return_Itor iterators of the same type they are called with. But even so, the function signature stated that_Skip()would take iterators of type_BidItand return an iterator of type_BidIt.1Footnotes
I think
_BidItis intended to refer to the wrapped and_Itto the unwrapped iterator type. But this intention hasn't been followed through on. This signature change fixes one inconsistency, but there is at least another one when assigning the capturing group iterators tomatch_resultsin_Matcher3::_Match(). And the apparent consequence of these inconsistencies is that theregex_match()/search()/replace()wrappers always set_BidItand_Itto denote the same type. ↩