]> asedeno.scripts.mit.edu Git - cl-protobufs.git/commitdiff
printer.lisp: consume more arguments when appropriate
authorAlejandro R Sedeño <asedeno@google.com>
Mon, 11 Feb 2013 23:32:17 +0000 (18:32 -0500)
committerAlejandro R Sedeño <asedeno@google.com>
Mon, 11 Feb 2013 23:32:30 +0000 (18:32 -0500)
Here we should have been consuming both the thing we would be printing
and the indentation we would use on the next line, but in the case
where the printed thing was nil, we would only consume it, and not the
subsequent indentation. It worked out here, but the mistake could only
be made once, and only at the end.

printer.lisp

index 003e4b070a40f238c11468c74561ad48327729e9..c37651ae9d29e2c52c1d0c12fa400e87c1aaedc2 100644 (file)
       (cond ((or other alias-for documentation source-location)
              (format stream "~%~@[~VT~](~:[~2*~;:name ~(~S~)~@[~%~VT~]~]~
                                         ~:[~2*~;:alias-for ~(~S~)~@[~%~VT~]~]~
-                                        ~:[~*~;:documentation ~S~@[~%~VT~]~]~
+                                        ~:[~2*~;:documentation ~S~@[~%~VT~]~]~
                                         ~:[~*~;:source-location ~/source-location/~])"
                      (+ indentation 4)
                      other other (and (or alias-for documentation) (+ indentation 5))
                                           ~:[~2*~;:name ~(~S~)~@[~%~VT~]~]~
                                           ~:[~2*~;:alias-for ~(~S~)~@[~%~VT~]~]~
                                           ~:[~2*~;:conc-name ~(~S~)~@[~%~VT~]~]~
-                                          ~:[~*~;:documentation ~S~@[~%~VT~]~]~
+                                          ~:[~2*~;:documentation ~S~@[~%~VT~]~]~
                                           ~:[~*~;:source-location ~/source-location/~])"
                        (+ indentation 4)
                        index (+ indentation 5)
                       (format stream "~%~@[~VT~](~:[~2*~;:name ~(~S~)~@[~%~VT~]~]~
                                                  ~:[~2*~;:alias-for ~(~S~)~@[~%~VT~]~]~
                                                  ~:[~2*~;:conc-name ~(~S~)~@[~%~VT~]~]~
-                                                 ~:[~*~;:documentation ~S~@[~%~VT~]~]~
+                                                 ~:[~2*~;:documentation ~S~@[~%~VT~]~]~
                                                  ~:[~*~;:source-location ~/source-location/~])"
                               (+ indentation 4)
                               other other (and (or alias-for conc-name documentation source-location) (+ indentation 5))
     (format stream "~&~@[~VT~](proto:define-service ~(~S~)"
             (and (not (zerop indentation)) indentation) (proto-class service))
     (cond ((or documentation source-location)
-           (format stream "~%~@[~VT~](~:[~*~;:documentation ~S~@[~%~VT~]~]~
+           (format stream "~%~@[~VT~](~:[~2*~;:documentation ~S~@[~%~VT~]~]~
                                       ~:[~*~;:source-location ~/source-location/~])"
                    (+ indentation 4)
                    documentation documentation (and source-location (+ indentation 5))