From 30d51888144edb9750ad0ea3c54a4b0a551a69a1 Mon Sep 17 00:00:00 2001 From: Robert Brown Date: Sun, 5 Feb 2012 18:21:27 -0500 Subject: [PATCH] Improve pretty printing of messages. --- protoc/lisp/message.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/protoc/lisp/message.cc b/protoc/lisp/message.cc index a6ab895..463d0c5 100644 --- a/protoc/lisp/message.cc +++ b/protoc/lisp/message.cc @@ -353,10 +353,7 @@ void MessageGenerator::GeneratePrintObject(io::Printer* printer) { printer->Print( "(cl:defmethod cl:print-object ((self $classname$) stream)\n" " (cl:print-unreadable-object" - " (self stream :type cl:t :identity cl:t)\n" - " (cl:pprint-logical-block (stream cl:nil)\n" -, -// " (cl:pprint-indent :block 1 stream)\n", + " (self stream :type cl:t :identity cl:t)\n", "classname", classname_); printer->Indent(); printer->Indent(); @@ -373,7 +370,7 @@ void MessageGenerator::GeneratePrintObject(io::Printer* printer) { // Use the getter so that string protobuf fields are output as Lisp // strings, not as arrays of octets. printer->Print( - " (cl:format stream \"~_$name$: ~s \" ($name$ self))", + " (cl:format stream \"$name$: ~s ~_\" ($name$ self))", "name", FieldName(field)); if (!field->is_repeated()) { printer->Print(")"); @@ -382,7 +379,7 @@ void MessageGenerator::GeneratePrintObject(io::Printer* printer) { printer->Print("\n"); } - printer->Print("))\n"); + printer->Print(")\n"); printer->Outdent(); printer->Print("(cl:values))\n"); printer->Outdent();