Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        public static string ToString(Template self)
        {
            TemplateDump d = new TemplateDump(self);

            return(d.ToString());
        }