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)))); }
public static TokenWriter Create(TextWriter writer, string indentation = "\t") { TokenWriter textwriter; if (writer != null) { textwriter = new TextWriterTokenWriter(writer) { IndentationString = indentation }; } else { textwriter = new NullWriterTokenWriter(); } return(new InsertSpecialsDecorator(new InsertRequiredSpacesDecorator(textwriter))); }
public string ConvertConstantValue(object constantValue) { return(TextWriterTokenWriter.PrintPrimitiveValue(constantValue)); }