Permalink
Browse files

Add a pprint-logical-block to message print-object functions.

  • Loading branch information...
1 parent 2042cc2 commit 793be4adca53b2330450d26a280aaa6090150484 @brown committed Feb 6, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 protoc/lisp/message.cc
View
@@ -353,10 +353,12 @@ 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",
+ " (self stream :type cl:t :identity cl:t)\n"
+ " (cl:pprint-logical-block (stream cl:nil)\n",
"classname", classname_);
printer->Indent();
printer->Indent();
+ printer->Indent();
for (int i = 0; i < descriptor_->field_count(); i++) {
const FieldDescriptor* field = descriptor_->field(i);
@@ -370,7 +372,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(")");
@@ -379,7 +381,8 @@ void MessageGenerator::GeneratePrintObject(io::Printer* printer) {
printer->Print("\n");
}
- printer->Print(")\n");
+ printer->Print("))\n");
+ printer->Outdent();
printer->Outdent();
printer->Print("(cl:values))\n");
printer->Outdent();

0 comments on commit 793be4a

Please sign in to comment.