Files
dotnet-runtime/docs/project
Stephen Toub 00aa6518a6 Add initial regex source generator (#59186)
* Add RegexGeneratorAttribute

Adds the new RegexGenerator attribute that's a signal to the regex
generator to generate code for the specified regex.

* Implement RegexGenerator

Add a source generator for generating C# code for Regex.  This is
primarily a port of RegexCompiler.cs, generating C# code instead of
MSIL.

* Add generator test project

Adds tests dedicated to the mechanics of the source generator, e.g. that
appropriate diagnostics are issued for improper use of RegexGenerator.

* Integrate source generator into many regex tests

Start integrating the source generator into the regex test suite, so
that many existing tests also validate the generated code.

* Address PR feedback

* Improve cachability of source generator

Changing the generator to not collect all regexes together means we don't need to reprocess/regenerate all regexes every time any one of them is changed.

* Use closest matching ctor from GetRegexAsync

To better test the appropriate ctor usage.

* Improve a few of the polyfills

* Address PR feedback

* Fully qualify types and remove unnecessary $s

Also fixed one place where the IL we were generating wasn't as good as the reflection emit code.

* Suppress a couple more warnings

* Fix stray !

* Fix TODO about unrolling multi comparisons

Also clean up generated code in a few places to make it more readable / concise.

* Update resources per PR feedback

* Add more tests, clean up parser code, and allow instance/interface methods

* Fix test suppression on mobile
2021-09-22 13:52:02 -04:00
..
2021-03-18 15:22:06 +01:00
2019-11-25 23:52:43 +01:00
2019-11-25 23:52:43 +01:00