From 8a7caa749e9f56d89823e9caf9e7d5802458ec60 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Wed, 20 Jun 2007 06:30:07 +0000 Subject: [PATCH] always strip placeholder wrappers svn: r6707 --- collects/scribble/reader.ss | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/collects/scribble/reader.ss b/collects/scribble/reader.ss index f909e675d3..664fd2e911 100644 --- a/collects/scribble/reader.ss +++ b/collects/scribble/reader.ss @@ -221,22 +221,24 @@ (placeholder? x))) stxs) (read-error "internal error [add-indents] ~s" stxs)) - (if (or (not (read-insert-indents)) (null? stxs)) - stxs - (let ([mincol (apply min (map syntax/placeholder-column stxs))]) - (let loop ([curline line-num] [stxs stxs] [r '()]) - (if (null? stxs) - (reverse! r) - (let* ([stx (car stxs)] [line (syntax/placeholder-line stx)]) - (loop line (cdr stxs) - (let ([stxcol (syntax/placeholder-column stx)] - [stx* (syntax/placeholder-strip stx)]) - (if (and (< curline line) (< mincol stxcol)) - (list* stx* - (datum->syntax-object/placeholder stx* - (make-spaces (- stxcol mincol))) - r) - (cons stx* r)))))))))) + (cond + [(not (read-insert-indents)) (map syntax/placeholder-strip stxs)] + [(null? stxs) '()] + [else (let ([mincol (apply min (map syntax/placeholder-column stxs))]) + (let loop ([curline line-num] [stxs stxs] [r '()]) + (if (null? stxs) + (reverse! r) + (let* ([stx (car stxs)] + [line (syntax/placeholder-line stx)]) + (loop line (cdr stxs) + (let ([stxcol (syntax/placeholder-column stx)] + [stx* (syntax/placeholder-strip stx)]) + (if (and (< curline line) (< mincol stxcol)) + (list* stx* + (datum->syntax-object/placeholder stx* + (make-spaces (- stxcol mincol))) + r) + (cons stx* r))))))))])) (define (get-lines) (define get