always strip placeholder wrappers

svn: r6707
This commit is contained in:
Eli Barzilay 2007-06-20 06:30:07 +00:00
parent b256869091
commit 8a7caa749e

View File

@ -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