Exemple #1
0
        public static string PrintPrimitiveValue(object value)
        {
            TextWriter            writer      = new StringWriter();
            TextWriterTokenWriter tokenWriter = new TextWriterTokenWriter(writer);

            tokenWriter.WritePrimitiveValue(value);
            return(writer.ToString());
        }
        public static TokenWriter CreateWriterThatSetsLocationsInAST(TextWriter writer, string indentation = "\t")
        {
            var target = new TextWriterTokenWriter(writer)
            {
                IndentationString = indentation
            };

            return(new InsertSpecialsDecorator(new InsertRequiredSpacesDecorator(new InsertMissingTokensDecorator(target, target))));
        }