Shovel.Compiler.Types.ParseTree.RenderToStringBuilder C# (CSharp) Method

RenderToStringBuilder() public method

public RenderToStringBuilder ( StringBuilder sb, int indentation ) : void
sb StringBuilder
indentation int
return void
        public void RenderToStringBuilder(StringBuilder sb, int indentation)
        {
            var content = String.IsNullOrEmpty(this.Content) ? "" : String.Format (" '{0}'", this.Content);
            sb.AppendFormat ("{4}{0} ({1} -- {2}){3}\n",
                             this.Label,
                             this.StartPos, this.EndPos,
                             content,
                             new String (' ', indentation));
            if (this.Children != null) {
                foreach (var child in this.Children) {
                    child.RenderToStringBuilder (sb, indentation + 2);
                }
            }
        }