File: Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs
Project: sdk-tasks.csproj (sdk-tasks)
// <auto-generated/>
#nullable enable
#pragma warning disable

namespace Microsoft.DotNet.Build.Tasks
{
    partial class GetWorkloadManifestLayout
    {
        /// <remarks>
        /// Pattern:<br/>
        /// <code>\A[0-9]+\.[0-9]+\.[0-9]*00(?:-.+)?\z</code><br/>
        /// Options:<br/>
        /// <code>RegexOptions.CultureInvariant</code><br/>
        /// Explanation:<br/>
        /// <code>
        /// ○ Match if at the beginning of the string.<br/>
        /// ○ Match a character in the set [0-9] atomically at least once.<br/>
        /// ○ Match '.'.<br/>
        /// ○ Match a character in the set [0-9] atomically at least once.<br/>
        /// ○ Match '.'.<br/>
        /// ○ Match a character in the set [0-9] greedily any number of times.<br/>
        /// ○ Match the string "00".<br/>
        /// ○ Optional (greedy).<br/>
        ///     ○ Match '-'.<br/>
        ///     ○ Match a character other than '\n' atomically at least once.<br/>
        /// ○ Match if at the end of the string.<br/>
        /// </code>
        /// </remarks>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "12.0.15.1201")]
        private static partial global::System.Text.RegularExpressions.Regex FeatureBandRegex() => global::System.Text.RegularExpressions.Generated.FeatureBandRegex_0.Instance;
    }
}

namespace Microsoft.DotNet.Build.Tasks
{
    partial class GetWorkloadManifestLayout
    {
        /// <remarks>
        /// Pattern:<br/>
        /// <code>\A[0-9]+\.[0-9]+\.[0-9]+(?:\.[0-9]+)?(?:[-+].+)?\z</code><br/>
        /// Options:<br/>
        /// <code>RegexOptions.CultureInvariant</code><br/>
        /// Explanation:<br/>
        /// <code>
        /// ○ Match if at the beginning of the string.<br/>
        /// ○ Match a character in the set [0-9] atomically at least once.<br/>
        /// ○ Match '.'.<br/>
        /// ○ Match a character in the set [0-9] atomically at least once.<br/>
        /// ○ Match '.'.<br/>
        /// ○ Match a character in the set [0-9] greedily at least once.<br/>
        /// ○ Optional (greedy).<br/>
        ///     ○ Match '.'.<br/>
        ///     ○ Match a character in the set [0-9] greedily at least once.<br/>
        /// ○ Optional (greedy).<br/>
        ///     ○ Match a character in the set [+\-].<br/>
        ///     ○ Match a character other than '\n' atomically at least once.<br/>
        /// ○ Match if at the end of the string.<br/>
        /// </code>
        /// </remarks>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "12.0.15.1201")]
        private static partial global::System.Text.RegularExpressions.Regex VersionRegex() => global::System.Text.RegularExpressions.Generated.VersionRegex_1.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 FeatureBandRegex method.</summary>
    [GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "12.0.15.1201")]
    [SkipLocalsInit]
    file sealed class FeatureBandRegex_0 : Regex
    {
        /// <summary>Cached, thread-safe singleton instance.</summary>
        internal static readonly FeatureBandRegex_0 Instance = new();
    
        /// <summary>Initializes the instance.</summary>
        private FeatureBandRegex_0()
        {
            base.pattern = "\\A[0-9]+\\.[0-9]+\\.[0-9]*00(?:-.+)?\\z";
            base.roptions = RegexOptions.CultureInvariant;
            ValidateMatchTimeout(Utilities.s_defaultTimeout);
            base.internalMatchTimeout = Utilities.s_defaultTimeout;
            base.factory = new RunnerFactory();
            base.capsize = 1;
        }
            
        /// <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 6 characters.
                    if (pos <= inputSpan.Length - 6)
                    {
                        // 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 charloop_starting_pos = 0, charloop_ending_pos = 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)
                    {
                        return false; // The input didn't match.
                    }
                    
                    // Match a character in the set [0-9] atomically at least once.
                    {
                        int iteration = slice.IndexOfAnyExceptInRange('0', '9');
                        if (iteration < 0)
                        {
                            iteration = slice.Length;
                        }
                        
                        if (iteration == 0)
                        {
                            return false; // The input didn't match.
                        }
                        
                        slice = slice.Slice(iteration);
                        pos += iteration;
                    }
                    
                    // Match '.'.
                    if (slice.IsEmpty || slice[0] != '.')
                    {
                        return false; // The input didn't match.
                    }
                    
                    // Match a character in the set [0-9] atomically at least once.
                    {
                        int iteration1 = slice.Slice(1).IndexOfAnyExceptInRange('0', '9');
                        if (iteration1 < 0)
                        {
                            iteration1 = slice.Length - 1;
                        }
                        
                        if (iteration1 == 0)
                        {
                            return false; // The input didn't match.
                        }
                        
                        slice = slice.Slice(iteration1);
                        pos += iteration1;
                    }
                    
                    // Match '.'.
                    if ((uint)slice.Length < 2 || slice[1] != '.')
                    {
                        return false; // The input didn't match.
                    }
                    
                    // Match a character in the set [0-9] greedily any number of times.
                    //{
                        pos += 2;
                        slice = inputSpan.Slice(pos);
                        charloop_starting_pos = pos;
                        
                        int iteration2 = slice.IndexOfAnyExceptInRange('0', '9');
                        if (iteration2 < 0)
                        {
                            iteration2 = slice.Length;
                        }
                        
                        slice = slice.Slice(iteration2);
                        pos += iteration2;
                        
                        charloop_ending_pos = pos;
                        goto CharLoopEnd;
                        
                        CharLoopBacktrack:
                        
                        if (Utilities.s_hasTimeout)
                        {
                            base.CheckTimeout();
                        }
                        
                        if (charloop_starting_pos >= charloop_ending_pos ||
                            (charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, Math.Min(inputSpan.Length, charloop_ending_pos + 1) - charloop_starting_pos).LastIndexOf("00")) < 0)
                        {
                            return false; // The input didn't match.
                        }
                        charloop_ending_pos += charloop_starting_pos;
                        pos = charloop_ending_pos;
                        slice = inputSpan.Slice(pos);
                        
                        CharLoopEnd:
                    //}
                    
                    // Match the string "00".
                    if (!slice.StartsWith("00"))
                    {
                        goto CharLoopBacktrack;
                    }
                    
                    // Optional (greedy).
                    //{
                        pos += 2;
                        slice = inputSpan.Slice(pos);
                        loop_iteration = 0;
                        
                        LoopBody:
                        Utilities.StackPush(ref base.runstack!, ref stackpos, pos);
                        
                        loop_iteration++;
                        
                        // Match '-'.
                        if (slice.IsEmpty || slice[0] != '-')
                        {
                            goto LoopIterationNoMatch;
                        }
                        
                        // Match a character other than '\n' atomically at least once.
                        {
                            int iteration3 = slice.Slice(1).IndexOf('\n');
                            if (iteration3 < 0)
                            {
                                iteration3 = slice.Length - 1;
                            }
                            
                            if (iteration3 == 0)
                            {
                                goto LoopIterationNoMatch;
                            }
                            
                            slice = slice.Slice(iteration3);
                            pos += iteration3;
                        }
                        
                        pos++;
                        slice = inputSpan.Slice(pos);
                        
                        // 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];
                        slice = inputSpan.Slice(pos);
                        LoopEnd:;
                    //}
                    
                    // Match if at the end of the string.
                    if ((uint)pos < (uint)inputSpan.Length)
                    {
                        goto LoopIterationNoMatch;
                    }
                    
                    // The input matched.
                    base.runtextpos = pos;
                    base.Capture(0, matchStart, pos);
                    return true;
                }
            }
        }

    }
    
    /// <summary>Custom <see cref="Regex"/>-derived type for the VersionRegex method.</summary>
    [GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "12.0.15.1201")]
    [SkipLocalsInit]
    file sealed class VersionRegex_1 : Regex
    {
        /// <summary>Cached, thread-safe singleton instance.</summary>
        internal static readonly VersionRegex_1 Instance = new();
    
        /// <summary>Initializes the instance.</summary>
        private VersionRegex_1()
        {
            base.pattern = "\\A[0-9]+\\.[0-9]+\\.[0-9]+(?:\\.[0-9]+)?(?:[-+].+)?\\z";
            base.roptions = RegexOptions.CultureInvariant;
            ValidateMatchTimeout(Utilities.s_defaultTimeout);
            base.internalMatchTimeout = Utilities.s_defaultTimeout;
            base.factory = new RunnerFactory();
            base.capsize = 1;
        }
            
        /// <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 5 characters.
                    if (pos <= inputSpan.Length - 5)
                    {
                        // 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;
                    char ch;
                    int charloop_starting_pos = 0, charloop_ending_pos = 0;
                    int charloop_starting_pos1 = 0, charloop_ending_pos1 = 0;
                    int loop_iteration = 0;
                    int loop_iteration1 = 0;
                    int stackpos = 0;
                    ReadOnlySpan<char> slice = inputSpan.Slice(pos);
                    
                    // Match if at the beginning of the string.
                    if (pos != 0)
                    {
                        return false; // The input didn't match.
                    }
                    
                    // Match a character in the set [0-9] atomically at least once.
                    {
                        int iteration = slice.IndexOfAnyExceptInRange('0', '9');
                        if (iteration < 0)
                        {
                            iteration = slice.Length;
                        }
                        
                        if (iteration == 0)
                        {
                            return false; // The input didn't match.
                        }
                        
                        slice = slice.Slice(iteration);
                        pos += iteration;
                    }
                    
                    // Match '.'.
                    if (slice.IsEmpty || slice[0] != '.')
                    {
                        return false; // The input didn't match.
                    }
                    
                    // Match a character in the set [0-9] atomically at least once.
                    {
                        int iteration1 = slice.Slice(1).IndexOfAnyExceptInRange('0', '9');
                        if (iteration1 < 0)
                        {
                            iteration1 = slice.Length - 1;
                        }
                        
                        if (iteration1 == 0)
                        {
                            return false; // The input didn't match.
                        }
                        
                        slice = slice.Slice(iteration1);
                        pos += iteration1;
                    }
                    
                    // Match '.'.
                    if ((uint)slice.Length < 2 || slice[1] != '.')
                    {
                        return false; // The input didn't match.
                    }
                    
                    // Match a character in the set [0-9] greedily at least once.
                    //{
                        pos += 2;
                        slice = inputSpan.Slice(pos);
                        charloop_starting_pos = pos;
                        
                        int iteration2 = slice.IndexOfAnyExceptInRange('0', '9');
                        if (iteration2 < 0)
                        {
                            iteration2 = slice.Length;
                        }
                        
                        if (iteration2 == 0)
                        {
                            return false; // The input didn't match.
                        }
                        
                        slice = slice.Slice(iteration2);
                        pos += iteration2;
                        
                        charloop_ending_pos = pos;
                        charloop_starting_pos++;
                        goto CharLoopEnd;
                        
                        CharLoopBacktrack:
                        
                        if (Utilities.s_hasTimeout)
                        {
                            base.CheckTimeout();
                        }
                        
                        if (charloop_starting_pos >= charloop_ending_pos)
                        {
                            return false; // The input didn't match.
                        }
                        pos = --charloop_ending_pos;
                        slice = inputSpan.Slice(pos);
                        
                        CharLoopEnd:
                    //}
                    
                    // Optional (greedy).
                    //{
                        loop_iteration = 0;
                        
                        LoopBody:
                        Utilities.StackPush(ref base.runstack!, ref stackpos, pos);
                        
                        loop_iteration++;
                        
                        // Match '.'.
                        if (slice.IsEmpty || slice[0] != '.')
                        {
                            goto LoopIterationNoMatch;
                        }
                        
                        // Match a character in the set [0-9] greedily at least once.
                        //{
                            pos++;
                            slice = inputSpan.Slice(pos);
                            charloop_starting_pos1 = pos;
                            
                            int iteration3 = slice.IndexOfAnyExceptInRange('0', '9');
                            if (iteration3 < 0)
                            {
                                iteration3 = slice.Length;
                            }
                            
                            if (iteration3 == 0)
                            {
                                goto LoopIterationNoMatch;
                            }
                            
                            slice = slice.Slice(iteration3);
                            pos += iteration3;
                            
                            charloop_ending_pos1 = pos;
                            charloop_starting_pos1++;
                            goto CharLoopEnd1;
                            
                            CharLoopBacktrack1:
                            Utilities.StackPop(base.runstack!, ref stackpos, out charloop_ending_pos1, out charloop_starting_pos1);
                            
                            if (Utilities.s_hasTimeout)
                            {
                                base.CheckTimeout();
                            }
                            
                            if (charloop_starting_pos1 >= charloop_ending_pos1)
                            {
                                goto LoopIterationNoMatch;
                            }
                            pos = --charloop_ending_pos1;
                            slice = inputSpan.Slice(pos);
                            
                            CharLoopEnd1:
                            Utilities.StackPush(ref base.runstack!, ref stackpos, charloop_starting_pos1, charloop_ending_pos1);
                        //}
                        
                        
                        // 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];
                        slice = inputSpan.Slice(pos);
                        goto LoopEnd;
                        
                        LoopBacktrack:
                        if (Utilities.s_hasTimeout)
                        {
                            base.CheckTimeout();
                        }
                        
                        if (loop_iteration == 0)
                        {
                            // No iterations of the loop remain to backtrack into. Fail the loop.
                            goto CharLoopBacktrack;
                        }
                        goto CharLoopBacktrack1;
                        LoopEnd:;
                    //}
                    
                    // Optional (greedy).
                    //{
                        loop_iteration1 = 0;
                        
                        LoopBody1:
                        Utilities.StackPush(ref base.runstack!, ref stackpos, pos);
                        
                        loop_iteration1++;
                        
                        // Match a character in the set [+\-].
                        if (slice.IsEmpty || (((ch = slice[0]) != '+') & (ch != '-')))
                        {
                            goto LoopIterationNoMatch1;
                        }
                        
                        // Match a character other than '\n' atomically at least once.
                        {
                            int iteration4 = slice.Slice(1).IndexOf('\n');
                            if (iteration4 < 0)
                            {
                                iteration4 = slice.Length - 1;
                            }
                            
                            if (iteration4 == 0)
                            {
                                goto LoopIterationNoMatch1;
                            }
                            
                            slice = slice.Slice(iteration4);
                            pos += iteration4;
                        }
                        
                        pos++;
                        slice = inputSpan.Slice(pos);
                        
                        // The loop has an upper bound of 1. Continue iterating greedily if it hasn't yet been reached.
                        if (loop_iteration1 == 0)
                        {
                            goto LoopBody1;
                        }
                        goto LoopEnd1;
                        
                        // The loop iteration failed. Put state back to the way it was before the iteration.
                        LoopIterationNoMatch1:
                        if (--loop_iteration1 < 0)
                        {
                            // Unable to match the remainder of the expression after exhausting the loop.
                            goto LoopBacktrack;
                        }
                        pos = base.runstack![--stackpos];
                        slice = inputSpan.Slice(pos);
                        LoopEnd1:;
                    //}
                    
                    // Match if at the end of the string.
                    if ((uint)pos < (uint)inputSpan.Length)
                    {
                        goto LoopIterationNoMatch1;
                    }
                    
                    // The input matched.
                    base.runtextpos = pos;
                    base.Capture(0, matchStart, pos);
                    return true;
                }
            }
        }

    }
    
    /// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary>
    [GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "12.0.15.1201")]
    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 1 value onto the backtracking stack.</summary>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        internal static void StackPush(ref int[] stack, ref int pos, int arg0)
        {
            // If there's space available for the value, store it.
            int[] s = stack;
            int p = pos;
            if ((uint)p < (uint)s.Length)
            {
                s[p] = arg0;
                pos++;
                return;
            }
        
            // Otherwise, resize the stack to make room and try again.
            WithResize(ref stack, ref pos, arg0);
        
            // <summary>Resize the backtracking stack array and push 1 value onto the stack.</summary>
            [MethodImpl(MethodImplOptions.NoInlining)]
            static void WithResize(ref int[] stack, ref int pos, int arg0)
            {
                Array.Resize(ref stack, (pos + 0) * 2);
                StackPush(ref stack, ref pos, arg0);
            }
        }
        
        /// <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);
            }
        }
    }
}