private static void WriteOrderedSet(ScriptWriter writer, ImmutableContextBase context, object value) { var set = (OrderedSet)value; writer.AppendItems(set, "<Set>[", "]", ",", item => WriteObject(writer, context, item.Value)); }
private static void WriteArrayLiteral(ScriptWriter writer, ImmutableContextBase context, object value) { var arrayLiteral = (ArrayLiteral)value; writer.AppendItems(arrayLiteral.Values, "[", "]", ",", item => WriteObject(writer, context, item.Value)); }
private static void WriteObjectLiteral(ScriptWriter writer, ImmutableContextBase context, object value) { var objLiteral = (ObjectLiteral)value; writer.AppendItems(objLiteral.Members, "{", "}", ",", member => { writer.AppendToken(member.Key.ToString(context.StringTable)); writer.AppendToken(": "); WriteObject(writer, context, member.Value.Value); }); }
private static void WriteOrderedMap(ScriptWriter writer, ImmutableContextBase context, object value) { var objLiteralN = (OrderedMap)value; writer.AppendItems(objLiteralN, "<Map>[", "]", ",", item => { writer.AppendToken("{ key: "); WriteObject(writer, context, item.Key.Value); writer.AppendToken(", value: "); WriteObject(writer, context, item.Value.Value); writer.AppendToken("}"); }); }