public static List <IOperationProvider> XmlConditionalSetup(string evaluatorType, bool wholeLine, bool trimWhiteSpace, string id)
        {
            // This is the operationId (flag) for the balanced nesting.
            string commentFixingOperationId = "Fix pseudo comments (XML)";

            // This is not an operationId (flag), it does not toggle the operation.
            // But conditional doesn't care, it takes the flags its given and sets them as appropriate.
            // It lets BalancedNesting know it's been reset.
            string commentFixingResetId = "Reset pseudo comment fixer (XML)";

            IOperationProvider balancedComments = new BalancedNesting("<!--", "-->", "-- >", commentFixingOperationId, commentFixingResetId);

            ConditionalTokens tokens = new ConditionalTokens
            {
                EndIfTokens            = new[] { "#endif", "<!--#endif" },
                ActionableIfTokens     = new[] { "<!--#if" },
                ActionableElseTokens   = new[] { "#else", "<!--#else" },
                ActionableElseIfTokens = new[] { "#elseif", "<!--#elseif" },
                ActionableOperations   = new[] { commentFixingOperationId, commentFixingResetId }
            };

            ConditionEvaluator evaluator   = EvaluatorSelector.Select(evaluatorType);
            IOperationProvider conditional = new Conditional(tokens, wholeLine, trimWhiteSpace, evaluator, id);

            return(new List <IOperationProvider>()
            {
                conditional,
                balancedComments
            });
        }
        public static List <IOperationProvider> GenerateConditionalSetup(string startToken, string endToken, string pseudoEndToken, ConditionalKeywords keywords, ConditionalOperationOptions options)
        {
            ConditionEvaluator evaluator = EvaluatorSelector.Select(options.EvaluatorType);

            ConditionalTokens tokens = new ConditionalTokens
            {
                EndIfTokens            = new[] { $"{keywords.KeywordPrefix}{keywords.EndIfKeyword}".TokenConfig(), $"{startToken}{keywords.KeywordPrefix}{keywords.EndIfKeyword}".TokenConfig() },
                ActionableIfTokens     = new[] { $"{startToken}{keywords.KeywordPrefix}{keywords.IfKeyword}".TokenConfig() },
                ActionableElseTokens   = new[] { $"{keywords.KeywordPrefix}{keywords.ElseKeyword}".TokenConfig(), $"{startToken}{keywords.KeywordPrefix}{keywords.ElseKeyword}".TokenConfig() },
                ActionableElseIfTokens = new[] { $"{keywords.KeywordPrefix}{keywords.ElseIfKeyword}".TokenConfig(), $"{startToken}{keywords.KeywordPrefix}{keywords.ElseIfKeyword}".TokenConfig() },
            };

            if (!string.IsNullOrWhiteSpace(pseudoEndToken))
            {
                Guid   operationIdGuid       = new Guid();
                string commentFixOperationId = $"Fix pseudo tokens ({pseudoEndToken} {operationIdGuid})";
                string commentFixResetId     = $"Reset pseudo token fixer ({pseudoEndToken} {operationIdGuid})";

                tokens.ActionableOperations = new[] { commentFixOperationId, commentFixResetId };

                IOperationProvider balancedComments = new BalancedNesting(startToken.TokenConfig(), endToken.TokenConfig(), pseudoEndToken.TokenConfig(), commentFixOperationId, commentFixResetId, options.OnByDefault);
                IOperationProvider conditional      = new Conditional(tokens, options.WholeLine, options.TrimWhitespace, evaluator, options.Id, options.OnByDefault);

                return(new List <IOperationProvider>()
                {
                    conditional,
                    balancedComments
                });
            }
            else
            {
                IOperationProvider conditional = new Conditional(tokens, options.WholeLine, options.TrimWhitespace, evaluator, options.Id, options.OnByDefault);
                return(new List <IOperationProvider>()
                {
                    conditional
                });
            }
        }