public SyntaxList <TNode> VisitList <TNode>(SyntaxList <TNode> list) where TNode : SyntaxNode { SyntaxListBuilder <TNode> alternate = default(SyntaxListBuilder <TNode>); int i = 0; int n = list.Count; while (i < n) { TNode item = list[i]; TNode visited = ((TNode)this.Visit(item)); if (item != visited && alternate.IsNull) { alternate = new SyntaxListBuilder <TNode>(n); alternate.AddRange(list, 0, i); } if (!alternate.IsNull) { if (visited != null && visited.Kind != SyntaxKind.None) { alternate.Add(visited); } } i += 1; } if (!alternate.IsNull) { return(alternate.ToList()); } return(list); }
public void AddRange(TNode[] items, int offset, int length) { _builder.AddRange(items, offset, length); }
// Add a trivia to the triva we are accumulating. private void AddTrivia(SyntaxNode trivia) { FinishInProgressTokens(); triviaListBuilder.AddRange(trivia); }