public virtual void Format(TextWriter tw, string indentString, int indentationLevel, string newLine)
{
if (indentationLevel < 0) indentationLevel = 0;
if (indentString == null) indentString = new string(' ', 4);
if (newLine == null) newLine = Environment.NewLine;
foreach (var tok in output)
{
switch (tok.TokenType)
{
case TokenType.Newline:
tw.Write(newLine + String.Concat(Enumerable.Repeat<string>(indentString, indentationLevel + tok.IndentationDepth.Value).ToArray()));
break;
default:
tw.Write(tok.Text);
break;
}
}
}