Skip to content

Conversation

@veanes
Copy link

@veanes veanes commented Jan 25, 2021

First major integration of SRM into .NET Regex.
Includes support for anchors and initial unit tests.

@dnfadmin
Copy link

dnfadmin commented Jan 25, 2021

CLA assistant check
All CLA requirements met.

@veanes
Copy link
Author

veanes commented Jan 26, 2021

As agreed, I added a public RegexOtions.DFA enum that triggers SRM from within the regex Run method.

@veanes
Copy link
Author

veanes commented Feb 2, 2021

Did a major rewrite of the core SRM matcher engine, now with full anchor support.
The code became much simpler and straightforward with a different (new) mechanism
for handling of anchors. Still some unit tests fail and some bugs are to be fixed.

namespace System.Text.RegularExpressions.SRM
{
[Serializable]
internal struct RegexOptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you're merging the code, seems the SRM versions of IgnoreCase, etc can be replaced by simply using the existing enum? And maybe retaining some of your helper methods here but no more need for any "mapping" from one to the other.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, removed SRM.RegexOptions.


/// <summary>
/// This method is here for perf reasons: if InitializeSRM is NOT called in the
/// Init method, we don't load SRM.Regex when instantiating a regex that does not use the DFA option
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's all in the same assembly, does no-inlining matter? The type will be loaded anyway, and Jitting will only happen if it ends up needing the code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the comment and the complier method attribute. Added another note there as a reminder that in fact RightToLeft can be supported now -- fairly easily I think.

Copy link
Member

@danmoseley danmoseley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't review the SRM parts, but looks good to me

@veanes
Copy link
Author

veanes commented Feb 5, 2021

This is great! Thanks!

@veanes veanes requested a review from stephentoub as a code owner February 5, 2021 19:31
@veanes
Copy link
Author

veanes commented Feb 5, 2021

I fixed the merge conflict in the project files.

@danmoseley
Copy link
Member

@veanes thanks, as you saw I did a big merge to bring everything up to date. That probably introduced the file header check as well.

@danmoseley danmoseley merged commit 9ac521b into dotnet:feature/regexsrm Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants