Skip to content
Discussion options

You must be logged in to vote

The generator belongs to dotnet/runtime repo.
The syntax looks necessary to me.

Couldn't you make an attribute or keyword alone (e.g. const) do the job at compile time to switch the Regular Expression to the new Regex Source Generator?

It can hardly be "switching". The code structure of using source generator and using constructor are fundamentally different. A method (or partial property, if it exists) is necessary to wrap the details.

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@HaloFour
Comment options

@jnm2
Comment options

jnm2 Oct 5, 2022
Collaborator

@333fred
Comment options

@SetTrend
Comment options

@jnm2
Comment options

jnm2 Oct 7, 2022
Collaborator

Answer selected by SetTrend
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants