better reader implementation
svn: r6767 original commit: c6415843425e5df5fcd33379ab6a58db145bb8f3
This commit is contained in:
parent
89f5bde7ba
commit
3c72a6622a
|
@ -4,21 +4,13 @@
|
||||||
(lib "kw.ss"))
|
(lib "kw.ss"))
|
||||||
|
|
||||||
(provide (rename *read read)
|
(provide (rename *read read)
|
||||||
(rename *read-syntax read-syntax))
|
(rename *read-syntax read-syntax))
|
||||||
|
|
||||||
(define (call-with-scribble-params t)
|
|
||||||
(parameterize ([scribble:read-insert-indents #f])
|
|
||||||
(t)))
|
|
||||||
|
|
||||||
(define/kw (*read #:optional [inp (current-input-port)])
|
(define/kw (*read #:optional [inp (current-input-port)])
|
||||||
(call-with-scribble-params
|
(wrap inp (scribble:read-inside inp)))
|
||||||
(lambda ()
|
|
||||||
(wrap inp (scribble:read-inside inp)))))
|
|
||||||
|
|
||||||
(define/kw (*read-syntax #:optional src [port (current-input-port)])
|
(define/kw (*read-syntax #:optional src [port (current-input-port)])
|
||||||
(call-with-scribble-params
|
(wrap port (scribble:read-inside-syntax src port))))
|
||||||
(lambda ()
|
|
||||||
(wrap port (scribble:read-inside-syntax src port)))))
|
|
||||||
|
|
||||||
(define (wrap port body)
|
(define (wrap port body)
|
||||||
(let* ([p-name (object-name port)]
|
(let* ([p-name (object-name port)]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user