From 3f9ee8fb806e3c5b975f971aba7c4af5ce0137f4 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Wed, 20 Jun 2007 04:29:10 +0000 Subject: [PATCH] always count lines svn: r6705 --- collects/scribble/reader.ss | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/collects/scribble/reader.ss b/collects/scribble/reader.ss index 5f30e9980f..f909e675d3 100644 --- a/collects/scribble/reader.ss +++ b/collects/scribble/reader.ss @@ -224,7 +224,6 @@ (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) @@ -376,25 +375,29 @@ (if (eq? src default-src) (object-name port) src)) (define/kw (*read #:optional [inp (current-input-port)]) + (port-count-lines! inp) (parameterize ([current-readtable at-readtable]) (read inp))) (define/kw (*read-syntax #:optional [src default-src] - [port (current-input-port)]) + [inp (current-input-port)]) + (port-count-lines! inp) (parameterize ([current-readtable at-readtable]) - (read-syntax (src-name src port) port))) + (read-syntax (src-name src inp) inp))) (define/kw (read-inside #:optional [inp (current-input-port)]) + (port-count-lines! inp) (let-values ([(line col pos) (port-next-location inp)]) (parameterize ([current-readtable at-readtable]) (syntax-object->datum ((dispatcher #t) #f inp (object-name inp) line col pos))))) (define/kw (read-inside-syntax #:optional [src default-src] - [port (current-input-port)]) - (let-values ([(line col pos) (port-next-location port)]) + [inp (current-input-port)]) + (port-count-lines! inp) + (let-values ([(line col pos) (port-next-location inp)]) (parameterize ([current-readtable at-readtable]) - ((dispatcher #t) #f port (src-name src port) line col pos)))) + ((dispatcher #t) #f inp (src-name src inp) line col pos)))) (provide (rename *read read) (rename *read-syntax read-syntax) read-inside read-inside-syntax)