better reader implementation

svn: r6767

original commit: c6415843425e5df5fcd33379ab6a58db145bb8f3
This commit is contained in:
Eli Barzilay 2007-06-29 07:40:01 +00:00
parent 89f5bde7ba
commit 3c72a6622a

View File

@ -4,21 +4,13 @@
(lib "kw.ss"))
(provide (rename *read read)
(rename *read-syntax read-syntax))
(define (call-with-scribble-params t)
(parameterize ([scribble:read-insert-indents #f])
(t)))
(rename *read-syntax read-syntax))
(define/kw (*read #:optional [inp (current-input-port)])
(call-with-scribble-params
(lambda ()
(wrap inp (scribble:read-inside inp)))))
(wrap inp (scribble:read-inside inp)))
(define/kw (*read-syntax #:optional src [port (current-input-port)])
(call-with-scribble-params
(lambda ()
(wrap port (scribble:read-inside-syntax src port)))))
(wrap port (scribble:read-inside-syntax src port))))
(define (wrap port body)
(let* ([p-name (object-name port)]