// <auto-generated/>
#nullable enable
#pragma warning disable
namespace Microsoft.DotNet.Cli.Commands.Test
{
partial class TestCommandDefinition
{
partial class MicrosoftTestingPlatform
{
/// <remarks>
/// Pattern:<br/>
/// <code>^(?<value>\d+(?:\.\d+)?)(?:\s*(?<suffix>ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?))$</code><br/>
/// Options:<br/>
/// <code>RegexOptions.IgnoreCase | RegexOptions.CultureInvariant</code><br/>
/// Explanation:<br/>
/// <code>
/// ○ Match if at the beginning of the string.<br/>
/// ○ "value" capture group.<br/>
/// ○ Match a Unicode digit greedily at least once.<br/>
/// ○ Optional (greedy).<br/>
/// ○ Match '.'.<br/>
/// ○ Match a Unicode digit atomically at least once.<br/>
/// ○ Match a whitespace character atomically any number of times.<br/>
/// ○ "suffix" capture group.<br/>
/// ○ Match with 5 alternative expressions.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Mm].<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a character in the set [Ss].<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Ii].<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Ll].<br/>
/// ○ Match a character in the set [Ss] atomically, optionally.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Ll] exactly 2 times.<br/>
/// ○ Match a character in the set [Ii].<br/>
/// ○ Match a character in the set [Ss].<br/>
/// ○ Match a character in the set [Ee].<br/>
/// ○ Match a character in the set [Cc].<br/>
/// ○ Match a character in the set [Oo].<br/>
/// ○ Match a character in the set [Nn].<br/>
/// ○ Match a character in the set [Dd].<br/>
/// ○ Match a character in the set [Ss] atomically, optionally.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Ss].<br/>
/// ○ Optional (lazy).<br/>
/// ○ Match a character in the set [Ee].<br/>
/// ○ Match a character in the set [Cc].<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a character in the set [Ss] atomically, optionally.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Oo].<br/>
/// ○ Match a character in the set [Nn].<br/>
/// ○ Match a character in the set [Dd].<br/>
/// ○ Match a character in the set [Ss] atomically, optionally.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Mm].<br/>
/// ○ Optional (lazy).<br/>
/// ○ Match a character in the set [Ii].<br/>
/// ○ Match a character in the set [Nn].<br/>
/// ○ Match with 2 alternative expressions.<br/>
/// ○ Match a character in the set [Ss] atomically, optionally.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Uu].<br/>
/// ○ Match a character in the set [Tt].<br/>
/// ○ Match a character in the set [Ee].<br/>
/// ○ Match a character in the set [Ss] atomically, optionally.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Hh].<br/>
/// ○ Optional (lazy).<br/>
/// ○ Match a character in the set [Oo].<br/>
/// ○ Match a character in the set [Uu].<br/>
/// ○ Match a character in the set [Rr].<br/>
/// ○ Match a character in the set [Ss] atomically, optionally.<br/>
/// ○ Match a sequence of expressions.<br/>
/// ○ Match a character in the set [Dd].<br/>
/// ○ Optional (lazy).<br/>
/// ○ Match a character in the set [Aa].<br/>
/// ○ Match a character in the set [Yy].<br/>
/// ○ Match a character in the set [Ss] atomically, optionally.<br/>
/// ○ Match if at the end of the string or if before an ending newline.<br/>
/// </code>
/// </remarks>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "11.0.14.38023")]
private static partial global::System.Text.RegularExpressions.Regex TimeoutPattern() => global::System.Text.RegularExpressions.Generated.TimeoutPattern_0.Instance;
}
}
}
namespace System.Text.RegularExpressions.Generated
{
using System;
using System.Buffers;
using System.CodeDom.Compiler;
using System.Collections;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
using System.Threading;
/// <summary>Custom <see cref="Regex"/>-derived type for the TimeoutPattern method.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "11.0.14.38023")]
file sealed class TimeoutPattern_0 : Regex
{
/// <summary>Cached, thread-safe singleton instance.</summary>
internal static readonly TimeoutPattern_0 Instance = new();
/// <summary>Initializes the instance.</summary>
private TimeoutPattern_0()
{
base.pattern = "^(?<value>\\d+(?:\\.\\d+)?)(?:\\s*(?<suffix>ms|mils?|milliseconds?|s|secs?|seconds?|m|mins?|minutes?|h|hours?|d|days?))$";
base.roptions = RegexOptions.IgnoreCase | RegexOptions.CultureInvariant;
ValidateMatchTimeout(Utilities.s_defaultTimeout);
base.internalMatchTimeout = Utilities.s_defaultTimeout;
base.factory = new RunnerFactory();
base.CapNames = new Hashtable { { "0", 0 } , { "suffix", 2 } , { "value", 1 } };
base.capslist = new string[] {"0", "value", "suffix" };
base.capsize = 3;
}
/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary>
private sealed class RunnerFactory : RegexRunnerFactory
{
/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary>
protected override RegexRunner CreateInstance() => new Runner();
/// <summary>Provides the runner that contains the custom logic implementing the specified regular expression.</summary>
private sealed class Runner : RegexRunner
{
/// <summary>Scan the <paramref name="inputSpan"/> starting from base.runtextstart for the next match.</summary>
/// <param name="inputSpan">The text being scanned by the regular expression.</param>
protected override void Scan(ReadOnlySpan<char> inputSpan)
{
// The pattern is anchored. Validate the current position and try to match at it only.
if (TryFindNextPossibleStartingPosition(inputSpan) && !TryMatchAtCurrentPosition(inputSpan))
{
base.runtextpos = inputSpan.Length;
}
}
/// <summary>Search <paramref name="inputSpan"/> starting from base.runtextpos for the next location a match could possibly start.</summary>
/// <param name="inputSpan">The text being scanned by the regular expression.</param>
/// <returns>true if a possible match was found; false if no more matches are possible.</returns>
private bool TryFindNextPossibleStartingPosition(ReadOnlySpan<char> inputSpan)
{
int pos = base.runtextpos;
// Any possible match is at least 2 characters.
if (pos <= inputSpan.Length - 2)
{
// The pattern leads with a beginning (\A) anchor.
if (pos == 0)
{
return true;
}
}
// No match found.
base.runtextpos = inputSpan.Length;
return false;
}
/// <summary>Determine whether <paramref name="inputSpan"/> at base.runtextpos is a match for the regular expression.</summary>
/// <param name="inputSpan">The text being scanned by the regular expression.</param>
/// <returns>true if the regular expression matches at the current position; otherwise, false.</returns>
private bool TryMatchAtCurrentPosition(ReadOnlySpan<char> inputSpan)
{
int pos = base.runtextpos;
int matchStart = pos;
int alternation_branch = 0;
int alternation_branch1 = 0;
int alternation_branch2 = 0;
int alternation_starting_capturepos = 0;
int alternation_starting_capturepos1 = 0;
int alternation_starting_capturepos2 = 0;
int alternation_starting_pos = 0;
int alternation_starting_pos1 = 0;
int alternation_starting_pos2 = 0;
int capture_starting_pos = 0;
int capture_starting_pos1 = 0;
int charloop_capture_pos = 0;
int charloop_starting_pos = 0, charloop_ending_pos = 0;
int lazyloop_iteration = 0;
int lazyloop_iteration1 = 0;
int lazyloop_iteration2 = 0;
int lazyloop_iteration3 = 0;
int loop_iteration = 0;
int stackpos = 0;
ReadOnlySpan<char> slice = inputSpan.Slice(pos);
// Match if at the beginning of the string.
if (pos != 0)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
// "value" capture group.
//{
capture_starting_pos = pos;
// Match a Unicode digit greedily at least once.
//{
charloop_starting_pos = pos;
int iteration = 0;
while ((uint)iteration < (uint)slice.Length && char.IsDigit(slice[iteration]))
{
iteration++;
}
if (iteration == 0)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
slice = slice.Slice(iteration);
pos += iteration;
charloop_ending_pos = pos;
charloop_starting_pos++;
goto CharLoopEnd;
CharLoopBacktrack:
UncaptureUntil(charloop_capture_pos);
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
if (charloop_starting_pos >= charloop_ending_pos)
{
UncaptureUntil(0);
return false; // The input didn't match.
}
pos = --charloop_ending_pos;
slice = inputSpan.Slice(pos);
CharLoopEnd:
charloop_capture_pos = base.Crawlpos();
//}
// Optional (greedy).
//{
loop_iteration = 0;
LoopBody:
Utilities.StackPush(ref base.runstack!, ref stackpos, base.Crawlpos(), pos);
loop_iteration++;
// Match '.'.
if (slice.IsEmpty || slice[0] != '.')
{
goto LoopIterationNoMatch;
}
// Match a Unicode digit atomically at least once.
{
pos++;
slice = inputSpan.Slice(pos);
int iteration1 = 0;
while ((uint)iteration1 < (uint)slice.Length && char.IsDigit(slice[iteration1]))
{
iteration1++;
}
if (iteration1 == 0)
{
goto LoopIterationNoMatch;
}
slice = slice.Slice(iteration1);
pos += iteration1;
}
// The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
if (loop_iteration == 0)
{
goto LoopBody;
}
goto LoopEnd;
// The loop iteration failed. Put state back to the way it was before the iteration.
LoopIterationNoMatch:
if (--loop_iteration < 0)
{
// Unable to match the remainder of the expression after exhausting the loop.
goto CharLoopBacktrack;
}
pos = base.runstack![--stackpos];
UncaptureUntil(base.runstack![--stackpos]);
slice = inputSpan.Slice(pos);
LoopEnd:;
//}
base.Capture(1, capture_starting_pos, pos);
goto CaptureSkipBacktrack;
CaptureBacktrack:
goto LoopIterationNoMatch;
CaptureSkipBacktrack:;
//}
// Match a whitespace character atomically any number of times.
{
int iteration2 = 0;
while ((uint)iteration2 < (uint)slice.Length && char.IsWhiteSpace(slice[iteration2]))
{
iteration2++;
}
slice = slice.Slice(iteration2);
pos += iteration2;
}
// "suffix" capture group.
//{
capture_starting_pos1 = pos;
// Match with 5 alternative expressions.
//{
alternation_starting_pos = pos;
alternation_starting_capturepos = base.Crawlpos();
// Branch 0
//{
// Match a character in the set [Mm].
if (slice.IsEmpty || ((slice[0] | 0x20) != 'm'))
{
goto AlternationBranch;
}
// Match with 2 alternative expressions.
//{
alternation_starting_pos1 = pos;
alternation_starting_capturepos1 = base.Crawlpos();
// Branch 0
//{
// Match a character in the set [Ss].
if ((uint)slice.Length < 2 || ((slice[1] | 0x20) != 's'))
{
goto AlternationBranch1;
}
alternation_branch1 = 0;
pos += 2;
slice = inputSpan.Slice(pos);
goto AlternationMatch1;
AlternationBranch1:
pos = alternation_starting_pos1;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos1);
//}
// Branch 1
//{
// Match a character in the set [Ii].
if ((uint)slice.Length < 2 || ((slice[1] | 0x20) != 'i'))
{
goto AlternationBranch;
}
// Match with 2 alternative expressions.
//{
alternation_starting_pos2 = pos;
alternation_starting_capturepos2 = base.Crawlpos();
// Branch 0
//{
// Match a character in the set [Ll].
if ((uint)slice.Length < 3 || ((slice[2] | 0x20) != 'l'))
{
goto AlternationBranch2;
}
// Match a character in the set [Ss] atomically, optionally.
{
if ((uint)slice.Length > (uint)3 && ((slice[3] | 0x20) == 's'))
{
slice = slice.Slice(1);
pos++;
}
}
alternation_branch2 = 0;
pos += 3;
slice = inputSpan.Slice(pos);
goto AlternationMatch2;
AlternationBranch2:
pos = alternation_starting_pos2;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos2);
//}
// Branch 1
//{
if ((uint)slice.Length < 11 ||
!slice.Slice(2).StartsWith("llisecond", StringComparison.OrdinalIgnoreCase)) // Match the string "llisecond" (ordinal case-insensitive)
{
goto AlternationBranch;
}
// Match a character in the set [Ss] atomically, optionally.
{
if ((uint)slice.Length > (uint)11 && ((slice[11] | 0x20) == 's'))
{
slice = slice.Slice(1);
pos++;
}
}
alternation_branch2 = 1;
pos += 11;
slice = inputSpan.Slice(pos);
goto AlternationMatch2;
//}
AlternationBacktrack2:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
switch (alternation_branch2)
{
case 0:
goto AlternationBranch2;
case 1:
goto AlternationBranch;
}
AlternationMatch2:;
//}
alternation_branch1 = 1;
goto AlternationMatch1;
//}
AlternationBacktrack1:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
switch (alternation_branch1)
{
case 0:
goto AlternationBranch1;
case 1:
goto AlternationBacktrack2;
}
AlternationMatch1:;
//}
alternation_branch = 0;
goto AlternationMatch;
AlternationBranch:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos);
//}
// Branch 1
//{
// Match a character in the set [Ss].
if (slice.IsEmpty || ((slice[0] | 0x20) != 's'))
{
goto AlternationBranch3;
}
// Optional (lazy).
//{
pos++;
slice = inputSpan.Slice(pos);
lazyloop_iteration = 0;
goto LazyLoopEnd;
LazyLoopBody:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos, base.Crawlpos());
lazyloop_iteration++;
if ((uint)slice.Length < 2 ||
!slice.StartsWith("ec", StringComparison.OrdinalIgnoreCase)) // Match the string "ec" (ordinal case-insensitive)
{
goto LazyLoopIterationNoMatch;
}
// Match with 2 alternative expressions.
//{
int alternation_starting_pos3 = pos;
int alternation_starting_capturepos3 = base.Crawlpos();
// Branch 0
//{
// Match a character in the set [Ss] atomically, optionally.
{
if ((uint)slice.Length > (uint)2 && ((slice[2] | 0x20) == 's'))
{
slice = slice.Slice(1);
pos++;
}
}
Utilities.StackPush(ref base.runstack!, ref stackpos, 0, alternation_starting_pos3, alternation_starting_capturepos3);
pos += 2;
slice = inputSpan.Slice(pos);
goto AlternationMatch3;
AlternationBranch4:
pos = alternation_starting_pos3;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos3);
//}
// Branch 1
//{
if ((uint)slice.Length < 5 ||
!slice.Slice(2).StartsWith("ond", StringComparison.OrdinalIgnoreCase)) // Match the string "ond" (ordinal case-insensitive)
{
goto LazyLoopIterationNoMatch;
}
// Match a character in the set [Ss] atomically, optionally.
{
if ((uint)slice.Length > (uint)5 && ((slice[5] | 0x20) == 's'))
{
slice = slice.Slice(1);
pos++;
}
}
Utilities.StackPush(ref base.runstack!, ref stackpos, 1, alternation_starting_pos3, alternation_starting_capturepos3);
pos += 5;
slice = inputSpan.Slice(pos);
goto AlternationMatch3;
//}
AlternationBacktrack3:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
Utilities.StackPop(base.runstack!, ref stackpos, out alternation_starting_capturepos3, out alternation_starting_pos3);
switch (base.runstack![--stackpos])
{
case 0:
goto AlternationBranch4;
case 1:
goto LazyLoopIterationNoMatch;
}
AlternationMatch3:;
//}
goto LazyLoopEnd;
// The lazy loop iteration failed to match.
LazyLoopIterationNoMatch:
lazyloop_iteration--;
UncaptureUntil(base.runstack![--stackpos]);
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
if (lazyloop_iteration > 0)
{
// The lazy loop matched at least one iteration; backtrack into the last one.
goto AlternationBacktrack3;
}
goto AlternationBranch3;
LazyLoopEnd:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos, base.Crawlpos());
goto LazyLoopSkipBacktrack;
LazyLoopBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
UncaptureUntil(base.runstack![--stackpos]);
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
// If the upper bound 1 has already been reached,
// don't continue lazily iterating. Instead, backtrack.
if (lazyloop_iteration != 0)
{
goto AlternationBacktrack3;
}
goto LazyLoopBody;
LazyLoopSkipBacktrack:;
//}
alternation_branch = 1;
goto AlternationMatch;
AlternationBranch3:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos);
//}
// Branch 2
//{
// Match a character in the set [Mm].
if (slice.IsEmpty || ((slice[0] | 0x20) != 'm'))
{
goto AlternationBranch5;
}
// Optional (lazy).
//{
pos++;
slice = inputSpan.Slice(pos);
lazyloop_iteration1 = 0;
goto LazyLoopEnd1;
LazyLoopBody1:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos, base.Crawlpos());
lazyloop_iteration1++;
if ((uint)slice.Length < 2 ||
!slice.StartsWith("in", StringComparison.OrdinalIgnoreCase)) // Match the string "in" (ordinal case-insensitive)
{
goto LazyLoopIterationNoMatch1;
}
// Match with 2 alternative expressions.
//{
int alternation_starting_pos4 = pos;
int alternation_starting_capturepos4 = base.Crawlpos();
// Branch 0
//{
// Match a character in the set [Ss] atomically, optionally.
{
if ((uint)slice.Length > (uint)2 && ((slice[2] | 0x20) == 's'))
{
slice = slice.Slice(1);
pos++;
}
}
Utilities.StackPush(ref base.runstack!, ref stackpos, 0, alternation_starting_pos4, alternation_starting_capturepos4);
pos += 2;
slice = inputSpan.Slice(pos);
goto AlternationMatch4;
AlternationBranch6:
pos = alternation_starting_pos4;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos4);
//}
// Branch 1
//{
if ((uint)slice.Length < 5 ||
!slice.Slice(2).StartsWith("ute", StringComparison.OrdinalIgnoreCase)) // Match the string "ute" (ordinal case-insensitive)
{
goto LazyLoopIterationNoMatch1;
}
// Match a character in the set [Ss] atomically, optionally.
{
if ((uint)slice.Length > (uint)5 && ((slice[5] | 0x20) == 's'))
{
slice = slice.Slice(1);
pos++;
}
}
Utilities.StackPush(ref base.runstack!, ref stackpos, 1, alternation_starting_pos4, alternation_starting_capturepos4);
pos += 5;
slice = inputSpan.Slice(pos);
goto AlternationMatch4;
//}
AlternationBacktrack4:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
Utilities.StackPop(base.runstack!, ref stackpos, out alternation_starting_capturepos4, out alternation_starting_pos4);
switch (base.runstack![--stackpos])
{
case 0:
goto AlternationBranch6;
case 1:
goto LazyLoopIterationNoMatch1;
}
AlternationMatch4:;
//}
goto LazyLoopEnd1;
// The lazy loop iteration failed to match.
LazyLoopIterationNoMatch1:
lazyloop_iteration1--;
UncaptureUntil(base.runstack![--stackpos]);
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
if (lazyloop_iteration1 > 0)
{
// The lazy loop matched at least one iteration; backtrack into the last one.
goto AlternationBacktrack4;
}
goto AlternationBranch5;
LazyLoopEnd1:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos, base.Crawlpos());
goto LazyLoopSkipBacktrack1;
LazyLoopBacktrack1:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
UncaptureUntil(base.runstack![--stackpos]);
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
// If the upper bound 1 has already been reached,
// don't continue lazily iterating. Instead, backtrack.
if (lazyloop_iteration1 != 0)
{
goto AlternationBacktrack4;
}
goto LazyLoopBody1;
LazyLoopSkipBacktrack1:;
//}
alternation_branch = 2;
goto AlternationMatch;
AlternationBranch5:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos);
//}
// Branch 3
//{
// Match a character in the set [Hh].
if (slice.IsEmpty || ((slice[0] | 0x20) != 'h'))
{
goto AlternationBranch7;
}
// Optional (lazy).
//{
pos++;
slice = inputSpan.Slice(pos);
lazyloop_iteration2 = 0;
goto LazyLoopEnd2;
LazyLoopBody2:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos, base.Crawlpos());
lazyloop_iteration2++;
if ((uint)slice.Length < 3 ||
!slice.StartsWith("our", StringComparison.OrdinalIgnoreCase)) // Match the string "our" (ordinal case-insensitive)
{
goto LazyLoopIterationNoMatch2;
}
// Match a character in the set [Ss] atomically, optionally.
{
if ((uint)slice.Length > (uint)3 && ((slice[3] | 0x20) == 's'))
{
slice = slice.Slice(1);
pos++;
}
}
pos += 3;
slice = inputSpan.Slice(pos);
goto LazyLoopEnd2;
// The lazy loop iteration failed to match.
LazyLoopIterationNoMatch2:
lazyloop_iteration2--;
UncaptureUntil(base.runstack![--stackpos]);
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
stackpos -= lazyloop_iteration2 * 2;
goto AlternationBranch7;
LazyLoopEnd2:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos, base.Crawlpos());
goto LazyLoopSkipBacktrack2;
LazyLoopBacktrack2:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
UncaptureUntil(base.runstack![--stackpos]);
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
// If the upper bound 1 has already been reached,
// don't continue lazily iterating. Instead, backtrack.
if (lazyloop_iteration2 != 0)
{
stackpos -= lazyloop_iteration2 * 2;
goto AlternationBranch7;
}
goto LazyLoopBody2;
LazyLoopSkipBacktrack2:;
//}
alternation_branch = 3;
goto AlternationMatch;
AlternationBranch7:
pos = alternation_starting_pos;
slice = inputSpan.Slice(pos);
UncaptureUntil(alternation_starting_capturepos);
//}
// Branch 4
//{
// Match a character in the set [Dd].
if (slice.IsEmpty || ((slice[0] | 0x20) != 'd'))
{
goto CaptureBacktrack;
}
// Optional (lazy).
//{
pos++;
slice = inputSpan.Slice(pos);
lazyloop_iteration3 = 0;
goto LazyLoopEnd3;
LazyLoopBody3:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos, base.Crawlpos());
lazyloop_iteration3++;
if ((uint)slice.Length < 2 ||
!slice.StartsWith("ay", StringComparison.OrdinalIgnoreCase)) // Match the string "ay" (ordinal case-insensitive)
{
goto LazyLoopIterationNoMatch3;
}
// Match a character in the set [Ss] atomically, optionally.
{
if ((uint)slice.Length > (uint)2 && ((slice[2] | 0x20) == 's'))
{
slice = slice.Slice(1);
pos++;
}
}
pos += 2;
slice = inputSpan.Slice(pos);
goto LazyLoopEnd3;
// The lazy loop iteration failed to match.
LazyLoopIterationNoMatch3:
lazyloop_iteration3--;
UncaptureUntil(base.runstack![--stackpos]);
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
stackpos -= lazyloop_iteration3 * 2;
goto CaptureBacktrack;
LazyLoopEnd3:
Utilities.StackPush(ref base.runstack!, ref stackpos, pos, base.Crawlpos());
goto LazyLoopSkipBacktrack3;
LazyLoopBacktrack3:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
UncaptureUntil(base.runstack![--stackpos]);
pos = base.runstack![--stackpos];
slice = inputSpan.Slice(pos);
// If the upper bound 1 has already been reached,
// don't continue lazily iterating. Instead, backtrack.
if (lazyloop_iteration3 != 0)
{
stackpos -= lazyloop_iteration3 * 2;
goto CaptureBacktrack;
}
goto LazyLoopBody3;
LazyLoopSkipBacktrack3:;
//}
alternation_branch = 4;
goto AlternationMatch;
//}
AlternationBacktrack:
if (Utilities.s_hasTimeout)
{
base.CheckTimeout();
}
switch (alternation_branch)
{
case 0:
goto AlternationBacktrack1;
case 1:
goto LazyLoopBacktrack;
case 2:
goto LazyLoopBacktrack1;
case 3:
goto LazyLoopBacktrack2;
case 4:
goto LazyLoopBacktrack3;
}
AlternationMatch:;
//}
base.Capture(2, capture_starting_pos1, pos);
goto CaptureSkipBacktrack1;
CaptureBacktrack1:
goto AlternationBacktrack;
CaptureSkipBacktrack1:;
//}
// Match if at the end of the string or if before an ending newline.
if (pos < inputSpan.Length - 1 || ((uint)pos < (uint)inputSpan.Length && inputSpan[pos] != '\n'))
{
goto CaptureBacktrack1;
}
// The input matched.
base.runtextpos = pos;
base.Capture(0, matchStart, pos);
return true;
// <summary>Undo captures until it reaches the specified capture position.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
void UncaptureUntil(int capturePosition)
{
while (base.Crawlpos() > capturePosition)
{
base.Uncapture();
}
}
}
}
}
}
/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary>
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "11.0.14.38023")]
file static class Utilities
{
/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary>
internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout;
/// <summary>Whether <see cref="s_defaultTimeout"/> is non-infinite.</summary>
internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
/// <summary>Pops 2 values from the backtracking stack.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void StackPop(int[] stack, ref int pos, out int arg0, out int arg1)
{
arg0 = stack[--pos];
arg1 = stack[--pos];
}
/// <summary>Pushes 2 values onto the backtracking stack.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void StackPush(ref int[] stack, ref int pos, int arg0, int arg1)
{
// If there's space available for all 2 values, store them.
int[] s = stack;
int p = pos;
if ((uint)(p + 1) < (uint)s.Length)
{
s[p] = arg0;
s[p + 1] = arg1;
pos += 2;
return;
}
// Otherwise, resize the stack to make room and try again.
WithResize(ref stack, ref pos, arg0, arg1);
// <summary>Resize the backtracking stack array and push 2 values onto the stack.</summary>
[MethodImpl(MethodImplOptions.NoInlining)]
static void WithResize(ref int[] stack, ref int pos, int arg0, int arg1)
{
Array.Resize(ref stack, (pos + 1) * 2);
StackPush(ref stack, ref pos, arg0, arg1);
}
}
/// <summary>Pushes 3 values onto the backtracking stack.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void StackPush(ref int[] stack, ref int pos, int arg0, int arg1, int arg2)
{
// If there's space available for all 3 values, store them.
int[] s = stack;
int p = pos;
if ((uint)(p + 2) < (uint)s.Length)
{
s[p] = arg0;
s[p + 1] = arg1;
s[p + 2] = arg2;
pos += 3;
return;
}
// Otherwise, resize the stack to make room and try again.
WithResize(ref stack, ref pos, arg0, arg1, arg2);
// <summary>Resize the backtracking stack array and push 3 values onto the stack.</summary>
[MethodImpl(MethodImplOptions.NoInlining)]
static void WithResize(ref int[] stack, ref int pos, int arg0, int arg1, int arg2)
{
Array.Resize(ref stack, (pos + 2) * 2);
StackPush(ref stack, ref pos, arg0, arg1, arg2);
}
}
}
}