Пример #1
0
        public SyntaxTree Get(SourceText sourceText)
        {
            Requires.NotNull(sourceText, nameof(sourceText));

            SyntaxTree syntaxTree;

            if (this.sources.TryGetValue(sourceText, out syntaxTree))
            {
                return(syntaxTree);
            }

            using (var stream = sourceText.GetStream())
                syntaxTree = SyntaxTree.CreateFromSteam(stream);
            this.sources.Add(sourceText, syntaxTree);

            return(syntaxTree);
        }