Skip to content
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

Add initial regex source generator #59186

Merged
merged 16 commits into from
Sep 22, 2021

Commits on Sep 22, 2021

  1. Add RegexGeneratorAttribute

    Adds the new RegexGenerator attribute that's a signal to the regex
    generator to generate code for the specified regex.
    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    dd903b0 View commit details
    Browse the repository at this point in the history
  2. 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.
    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    111a50b View commit details
    Browse the repository at this point in the history
  3. 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.
    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    2380294 View commit details
    Browse the repository at this point in the history
  4. 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.
    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    68fea06 View commit details
    Browse the repository at this point in the history
  5. Address PR feedback

    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    e18adbe View commit details
    Browse the repository at this point in the history
  6. 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.
    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    857caed View commit details
    Browse the repository at this point in the history
  7. Use closest matching ctor from GetRegexAsync

    To better test the appropriate ctor usage.
    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    2d4f159 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8abd7fb View commit details
    Browse the repository at this point in the history
  9. Address PR feedback

    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    fba00ee View commit details
    Browse the repository at this point in the history
  10. 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.
    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    3963f7f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    1c1c1f9 View commit details
    Browse the repository at this point in the history
  12. Fix stray !

    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    818f844 View commit details
    Browse the repository at this point in the history
  13. Fix TODO about unrolling multi comparisons

    Also clean up generated code in a few places to make it more readable / concise.
    stephentoub committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    2435db4 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    400147d View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    a07f142 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    e153b3a View commit details
    Browse the repository at this point in the history