Exemplo n.º 1
0
        private static void WriteOrderedSet(ScriptWriter writer, ImmutableContextBase context, object value)
        {
            var set = (OrderedSet)value;

            writer.AppendItems(set, "<Set>[", "]", ",",
                               item => WriteObject(writer, context, item.Value));
        }
Exemplo n.º 2
0
        private static void WriteArrayLiteral(ScriptWriter writer, ImmutableContextBase context, object value)
        {
            var arrayLiteral = (ArrayLiteral)value;

            writer.AppendItems(arrayLiteral.Values, "[", "]", ",",
                               item => WriteObject(writer, context, item.Value));
        }
Exemplo n.º 3
0
        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);
            });
        }
Exemplo n.º 4
0
        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("}");
            });
        }