Пример #1
0
 protected void RegisterChildNodes <T>(out SeparatedSyntaxList <T> nodes, SeparatedSyntaxList <T> values)
     where T : SyntaxNode
 {
     nodes = values;
     foreach (var childNode in values.GetWithSeparators())
     {
         SourceRange     = SourceRange.Union(SourceRange, childNode.SourceRange);
         FullSourceRange = SourceRange.Union(FullSourceRange, childNode.FullSourceRange);
         ChildNodes.Add(childNode);
         childNode.Parent = this;
     }
 }
Пример #2
0
        private static SourceRange ComputeFullSpan(SourceRange span, ImmutableArray <SyntaxNode> leadingTrivia, ImmutableArray <SyntaxNode> trailingTrivia)
        {
            var result = span;

            foreach (var childNode in leadingTrivia)
            {
                result = SourceRange.Union(result, childNode.FullSourceRange);
            }
            foreach (var childNode in trailingTrivia)
            {
                result = SourceRange.Union(result, childNode.FullSourceRange);
            }
            return(result);
        }
Пример #3
0
 protected void RegisterChildNode <T>(out T node, T value)
     where T : SyntaxNode
 {
     if (value == null)
     {
         node = null;
         return;
     }
     SourceRange     = SourceRange.Union(SourceRange, value.SourceRange);
     FullSourceRange = SourceRange.Union(FullSourceRange, value.FullSourceRange);
     node            = value;
     ChildNodes.Add(node);
     node.Parent = this;
 }