protected virtual string GetValueDebugString(object value, int n) { StringBuilder buf = new StringBuilder(); value = Interpreter.ConvertAnythingIteratableToIterator(value); if (value is Template) { TemplateDump d = new TemplateDump((Template)value); buf.Append(d.ToString(n)); } else if (value is Iterator) { Iterator it = (Iterator)value; int na = 0; while (it.hasNext()) { string v = GetValueDebugString(it.next(), n); if (na > 0) { buf.Append(", "); } buf.Append(v); na++; } } else { buf.Append(value); } return(buf.ToString()); }
public static string ToString(Template self) { TemplateDump d = new TemplateDump(self); return(d.ToString()); }