You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid RegexWriter for RegexOptions.Compiled, RegexOptions.NonBacktracking, and source generator #62450
RegexWriter is used to convert a RegexNode tree into a series of opcodes and operands. These used to be used by all of the engines, but they're now only used for RegexInterpreter. With a bit of refactoring, we can avoid using RegexWriter at all for anything other than the interpreter.
Started to look a little onto this. Seeps like there is still small dependencies here and there on the NonBacktracking and Compiled engines for the emitted code. For example, the compiled engine makes some decisions based on the FindOptimizations object located inside the RegexCode. That said, we can easily refactor the FindOptimizations out of the RegexCode since creating it really only needs the culture and regex tree. Same goes for other things currently held by RegexCode like CapSize, Caps and TrackCount.
Activity
joperezr commentedon Dec 15, 2021
Started to look a little onto this. Seeps like there is still small dependencies here and there on the NonBacktracking and Compiled engines for the emitted code. For example, the compiled engine makes some decisions based on the FindOptimizations object located inside the RegexCode. That said, we can easily refactor the FindOptimizations out of the RegexCode since creating it really only needs the culture and regex tree. Same goes for other things currently held by RegexCode like CapSize, Caps and TrackCount.