@@ -238,8 +238,10 @@ internal SymbolicRegexMatcher(SymbolicRegexNode<TSetType> sr, RegexCode code, Ch
238
238
/// <summary>Interface for transitions used by the <see cref="Delta"/> method.</summary>
239
239
private interface ITransition
240
240
{
241
+ #pragma warning disable CA2252 // This API requires opting into preview features
241
242
/// <summary>Find the next state given the current state and next character.</summary>
242
- DfaMatchingState < TSetType > TakeTransition ( SymbolicRegexMatcher < TSetType > matcher , DfaMatchingState < TSetType > currentState , int mintermId , TSetType minterm ) ;
243
+ static abstract DfaMatchingState < TSetType > TakeTransition ( SymbolicRegexMatcher < TSetType > matcher , DfaMatchingState < TSetType > currentState , int mintermId , TSetType minterm ) ;
244
+ #pragma warning restore CA2252
243
245
}
244
246
245
247
/// <summary>Compute the target state for the source state and input[i] character.</summary>
@@ -262,14 +264,14 @@ private DfaMatchingState<TSetType> Delta<TTransition>(ReadOnlySpan<char> input,
262
264
minterms [ mintermId ] :
263
265
_builder . _solver . False ; // minterm=False represents \Z
264
266
265
- return default ( TTransition ) . TakeTransition ( this , sourceState , mintermId , minterm ) ;
267
+ return TTransition . TakeTransition ( this , sourceState , mintermId , minterm ) ;
266
268
}
267
269
268
270
/// <summary>Transition for Brzozowski-style derivatives (i.e. a DFA).</summary>
269
271
private readonly struct BrzozowskiTransition : ITransition
270
272
{
271
273
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
272
- public DfaMatchingState < TSetType > TakeTransition (
274
+ public static DfaMatchingState < TSetType > TakeTransition (
273
275
SymbolicRegexMatcher < TSetType > matcher , DfaMatchingState < TSetType > currentState , int mintermId , TSetType minterm )
274
276
{
275
277
SymbolicRegexBuilder < TSetType > builder = matcher . _builder ;
@@ -284,13 +286,13 @@ public DfaMatchingState<TSetType> TakeTransition(
284
286
private readonly struct AntimirovTransition : ITransition
285
287
{
286
288
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
287
- public DfaMatchingState < TSetType > TakeTransition (
289
+ public static DfaMatchingState < TSetType > TakeTransition (
288
290
SymbolicRegexMatcher < TSetType > matcher , DfaMatchingState < TSetType > currentStates , int mintermId , TSetType minterm )
289
291
{
290
292
if ( currentStates . Node . Kind != SymbolicRegexKind . Or )
291
293
{
292
294
// Fall back to Brzozowski when the state is not a disjunction.
293
- return default ( BrzozowskiTransition ) . TakeTransition ( matcher , currentStates , mintermId , minterm ) ;
295
+ return BrzozowskiTransition . TakeTransition ( matcher , currentStates , mintermId , minterm ) ;
294
296
}
295
297
296
298
SymbolicRegexBuilder < TSetType > builder = matcher . _builder ;
0 commit comments