Have RegexInterpreter work over ReadOnlySpan<char> instead of strings.#62165
Merged
joperezr merged 3 commits intodotnet:mainfrom Dec 1, 2021
Merged
Have RegexInterpreter work over ReadOnlySpan<char> instead of strings.#62165joperezr merged 3 commits intodotnet:mainfrom
joperezr merged 3 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @eerhardt, @dotnet/area-system-text-regularexpressions Issue DetailsContributes to #59629 After chatting with @stephentoub offline, the approach we want to take to add support of spans on Regex will start by having the current engines move to working over Spans instead of strings. Once we have moved all engines do this, then we can add public surface area that takes in user spans, as opposed to strings. This first PR is making it so the RegexInterpreter engine no longer uses the runtext string, other than in FindFirstChar and Go methods for getting the actual Span out, which is used in the rest of the implementation.
|
danmoseley
reviewed
Nov 30, 2021
...raries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Nov 30, 2021
.../System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs
Show resolved
Hide resolved
stephentoub
reviewed
Nov 30, 2021
...raries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Nov 30, 2021
...raries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs
Outdated
Show resolved
Hide resolved
stephentoub
approved these changes
Nov 30, 2021
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Contributes to #59629
After chatting with @stephentoub offline, the approach we want to take to add support of spans on Regex will start by having the current engines move to working over Spans instead of strings. Once we have moved all engines do this, then we can add public surface area that takes in user spans, as opposed to strings.
This first PR is making it so the RegexInterpreter engine no longer uses the runtext string, other than in FindFirstChar and Go methods for getting the actual Span out, which is used in the rest of the implementation.
cc: @stephentoub @danmoseley