Inheritance: ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor
Ejemplo n.º 1
0
        private void CompressTypes()
        {
            var typesVisitor = new MinifyTypesAstVisitor(IgnoredIdentifiers, Options.PublicCompressing);

            CompileAndAcceptVisitor(typesVisitor);
            var substitutor  = new Substitutor(new MinIdGenerator());
            var ignoredNames = new List <string>(IgnoredIdentifiers);

            ignoredNames.AddRange(typesVisitor.NotTypesIdNames);
            var substitution = substitutor.Generate(typesVisitor.Types, ignoredNames.ToArray());

            var astSubstitution = new List <Tuple <string, List <AstNode> > >();

            foreach (var type in typesVisitor.Types)
            {
                astSubstitution.Add(new Tuple <string, List <AstNode> >(substitution[type.Name], GetResolvedNodes(ResolveResultType.Type, type.Node)));
            }

            RenameOrRemoveNodes(astSubstitution, false, Options.TypesCompressing);
        }
Ejemplo n.º 2
0
        private void CompressTypes()
        {
            var typesVisitor = new MinifyTypesAstVisitor(IgnoredIdentifiers, Options.PublicCompressing);
            CompileAndAcceptVisitor(typesVisitor);
            var substitutor = new Substitutor(new MinIdGenerator());
            var ignoredNames = new List<string>(IgnoredIdentifiers);
            ignoredNames.AddRange(typesVisitor.NotTypesIdNames);
            var substitution = substitutor.Generate(typesVisitor.Types, ignoredNames.ToArray());

            var astSubstitution = new List<Tuple<string, List<AstNode>>>();
            foreach (var type in typesVisitor.Types)
                astSubstitution.Add(new Tuple<string, List<AstNode>>(substitution[type.Name], GetResolvedNodes(ResolveResultType.Type, type.Node)));

            RenameOrRemoveNodes(astSubstitution, false, Options.TypesCompressing);
        }