public void Free(SyntaxListBuilder item) { if (item != null) { item.Clear(); _freeList.Push(item); } }
// Create a SkippedTokens trivia from any tokens currently accumulated into the skippedTokensBuilder. If not, // don't do anything. private void FinishInProgressTokens() { if (skippedTokensBuilder.Count > 0) { var skippedTokensTrivia = SyntaxFactory.SkippedTokensTrivia(skippedTokensBuilder.ToList()); if (diagnosticsToAdd != null) { foreach (var d in diagnosticsToAdd) { ////skippedTokensTrivia = skippedTokensTrivia.AddError(d); } diagnosticsToAdd = null; // only add once. } triviaListBuilder.Add(skippedTokensTrivia); skippedTokensBuilder.Clear(); } }
public void Clear() { _builder.Clear(); }