void DoJsonObject(BaseTerm t) // object, array or literal
            {
                jtb.EmitOpenBracket('{');
                bool first = true;

                // traverse list
                foreach (BaseTerm e in (ListTerm)t)
                {
                    jtb.AppendPossibleCommaAndNewLine(ref first, MaxIndentLevel); // '{' <pair>+ '}'
                    DoJsonPair(e);
                }

                jtb.EmitCloseBracket('}');
            }
Esempio n. 2
0
 static void DoJsonArray0(JsonTextBuffer avb, string attrName, ListTerm t, bool first)
 {
     avb.AppendPossibleCommaAndNewLine(first); // is this entire []-last the first element?
     avb.EmitOpenBracket(attrName, '[');
     DoJsonArray(avb, t, true);
     avb.EmitCloseBracket(']');
 }
Esempio n. 3
0
 static void DoJsonObject0(JsonTextBuffer avb, string attrName, BaseTerm t, bool first)
 {
     avb.AppendPossibleCommaAndNewLine(first); // is this entire {}-last the first element?
     avb.EmitOpenBracket(attrName, '{');
     DoJsonObject(avb, t, true);
     avb.EmitCloseBracket('}');
 }