mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-22 14:09:34 -10:00
* 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