Esempio n. 1
0
        public void Execute(RazorCodeDocument document)
        {
            var syntaxTree = document.GetSyntaxTree();

            if (syntaxTree == null)
            {
                syntaxTree = RazorParser.Parse(document.Source);
            }

            var passes = Engine.Features.OfType <ISyntaxTreePass>().OrderBy(p => p.Order).ToArray();

            foreach (var pass in passes)
            {
                syntaxTree = pass.Execute(document, syntaxTree);
            }

            document.SetSyntaxTree(syntaxTree);
        }