Пример #1
0
 private static TokenCollection Transform(CommandContext commandContext, TokenCollection tokenCollection)
 {
     return(tokenCollection.Transform(ExpandResponseFile, skipDirectives: true, skipSeparated: true));
 }
Пример #2
0
 internal static TokenCollection Transform(CommandContext commandContext, TokenCollection tokenCollection)
 {
     return(tokenCollection.Transform(ExpandClubbedOption, skipDirectives: true, skipSeparated: true));
 }
        internal static bool Transform(CommandContext commandContext, IEnumerable <TokenTransformation> transformations, TokenCollection tokens)
        {
            var appConfig = commandContext.AppConfig;

            foreach (var transformation in transformations)
            {
                try
                {
                    var tempArgs = transformation.Transformation(commandContext, tokens);
                    tempArgs.Where(t => t.SourceName.IsNullOrWhitespace()).ForEach(t => t.SourceName = transformation.Name);
                    appConfig.TokenizationEvents.TokenTransformation(commandContext, transformation, tokens, tempArgs);
                    tokens = tempArgs;
                }
                catch (Exception e)
                {
                    Log.Error($"Tokenizer error: {transformation} {e.Message}", e);
                    commandContext.Console.Error.WriteLine(e.Message);
                    return(false);
                }
            }
            commandContext.Tokens = tokens;
            return(true);
        }
Пример #4
0
 internal static TokenCollection Transform(CommandContext commandContext, TokenCollection tokenCollection)
 {
     return(tokenCollection.Transform(SplitOptionAssignment, skipDirectives: true, skipSeparated: true));
 }