[Openmcl-cvs-notifications] r10214 - /trunk/source/lib/pprint.lisp
gz at clozure.com
gz at clozure.com
Sun Jul 27 12:09:41 EDT 2008
Author: gz
Date: Sun Jul 27 12:09:41 2008
New Revision: 10214
Log:
Fix pretty printer to not remove quoted spaces at end of line
Modified:
trunk/source/lib/pprint.lisp
Modified: trunk/source/lib/pprint.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lib/pprint.lisp (original)
+++ trunk/source/lib/pprint.lisp Sun Jul 27 12:09:41 2008
@@ -954,15 +954,19 @@
;This prints out a line of stuff.
=
(defun output-line (xp Qentry)
- (flet ((find-not-char-reverse (char buffer out-point)
- (do ((i (%i- out-point 1) (%i- i 1)))
- (nil)
- (cond ((%i< i 0)(return nil))
- ((neq (schar buffer i) char)
- (return i))))))
+ (flet ((find-not-char-reverse (buffer out-point)
+ (declare (type simple-base-string buffer) (type fixnum out-point))
+ (do ((i (%i- out-point 1) (%i- i 1)))
+ ((%i< i 0) nil)
+ (when (or (neq (schar buffer i) #\Space)
+ ;; Don't match possibly-quoted space ("possibly" because the #\\ =
itself might be =
+ ;; quoted; don't bother checking for that, no big harm leaving th=
e space even if
+ ;; not totally necessary).
+ (and (%i< 0 i) (eq (schar buffer (%i- i 1)) #\\)))
+ (return i)))))
(let* ((queue (xp-queue xp))
(out-point (BP<-TP xp (xpq-pos queue Qentry)))
- (last-non-blank (find-not-char-reverse #\space (xp-buffer xp) out-poin=
t))
+ (last-non-blank (find-not-char-reverse (xp-buffer xp) out-point))
(end (cond ((memq (xpq-kind queue Qentry) '(:fresh :unconditional)) ou=
t-point)
(last-non-blank (%i+ 1 last-non-blank))
(T 0)))
More information about the Openmcl-cvs-notifications
mailing list