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; } }
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); }
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; }