Skip to content

Commit

Permalink
Improve pretty printing of messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
brown committed Feb 5, 2012
1 parent e1c4314 commit 30d5188
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions protoc/lisp/message.cc
Expand Up @@ -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();
Expand All @@ -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(")");
Expand All @@ -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();
Expand Down

0 comments on commit 30d5188

Please sign in to comment.