Repository navigation
Captures support for NonBacktracking #65129
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
Merged
+1,731
−580
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
21d2cd0
Initial version of captures in NonBacktracking
olsaarik 998321f
Working version of captures in NonBacktracking
olsaarik ba9cffd
State/transition priorities for NonBacktracking
olsaarik 55f6d27
Various fixes for capturing in NonBacktracking
olsaarik 7d400a4
Enable many subcapture tests for NonBacktracking
olsaarik 3436ba0
Use new eager derivative even without subcaptures
olsaarik 23f9299
Enable more subcapture tests for NonBacktracking
olsaarik 6b2797e
Performance work for NonBacktracking captures
olsaarik 1c44a5d
Bug fixes and comments
olsaarik 8b4be26
Fix for changes removing exclusive_end
olsaarik a0c8212
Rename back to _lower
olsaarik 0134dd3
Fix beginning handling for captures
olsaarik a8c7c20
Resurrect deleted test
olsaarik a908fa4
Remove debugging test
olsaarik 81951c1
Provide effects semantics for extended combinators
olsaarik 367d896
Apply suggestions from code review to SparseIntMap
olsaarik 45ef582
Apply suggestions from code review
olsaarik ef16f1e
Comments, fixes and cleanup
olsaarik e292eb8
Disable tests for extended features
olsaarik 990cc2d
Apply suggestions from code review
olsaarik dd552d8
Switch all phases to use eager derivative
olsaarik 432318a
Flatten ordered or and add subsumption
olsaarik 3de4a8f
Avoid some copies and overhead in capturing mode
olsaarik 3c805de
Improved comment and a better assert
olsaarik 1daf772
Move some per thread state into the runner
olsaarik 712332e
Fix typo in SparseIntMap
olsaarik 69fae0d
Various cleanup
olsaarik c68f859
Fix a comment
olsaarik a64f4cf
Avoid copying captures when doing quick match
olsaarik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
33 changes: 33 additions & 0 deletions
33
...m.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/DerivativeEffect.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace System.Text.RegularExpressions.Symbolic | ||
| { | ||
| /// <summary> | ||
| /// Describes effects to record capture start and end points. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// These are applied into registers (arrays of positions for all capture starts and ends) and amount to assignments | ||
| /// of the current input position. Effects are generated and associated with transitions in effect-aware versions | ||
| /// of MkDerivative in SymbolicRegexNode. | ||
| /// </remarks> | ||
| internal struct DerivativeEffect | ||
| { | ||
| public enum EffectKind | ||
| { | ||
| /// <summary>Effect to assign the current input position to an index in the capture starts array.</summary> | ||
| CaptureStart, | ||
| /// <summary>Effect to assign the current input position to an index in the capture ends array.</summary> | ||
| CaptureEnd, | ||
| }; | ||
|
|
||
| public EffectKind Kind; | ||
| public int CaptureNumber; | ||
|
|
||
| public DerivativeEffect(EffectKind kind, int captureNumber) | ||
| { | ||
| Kind = kind; | ||
| CaptureNumber = captureNumber; | ||
| } | ||
| } | ||
| } |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.