Use current-readtable as the base for the TR readtable.

Closes PR 1115.
This commit is contained in:
Sam Tobin-Hochstadt 2010-08-21 12:20:23 -04:00
parent f1e38247e0
commit 72f31ffec0
3 changed files with 14 additions and 5 deletions

View File

@ -0,0 +1,9 @@
#lang at-exp typed/racket
(define contents
(lambda args args))
(define doc @contents{x y})
@contents{x y}

View File

@ -14,5 +14,5 @@
(require (for-syntax typed-scheme/utils/tc-utils scheme/base)) (require (for-syntax typed-scheme/utils/tc-utils scheme/base))
(begin-for-syntax (set-box! typed-context? #t))) (begin-for-syntax (set-box! typed-context? #t)))
(current-namespace)) (current-namespace))
(current-readtable readtable)) (current-readtable (readtable)))

View File

@ -72,15 +72,15 @@
(let-values ([(l c p) (port-next-location port)]) (let-values ([(l c p) (port-next-location port)])
(list src line col pos (and pos (- p pos)))))])) (list src line col pos (and pos (- p pos)))))]))
(define readtable (define (readtable)
(make-readtable #f #\{ 'dispatch-macro parse-id-type)) (make-readtable (current-readtable) #\{ 'dispatch-macro parse-id-type))
(define (*read inp) (define (*read inp)
(parameterize ([current-readtable readtable]) (parameterize ([current-readtable (readtable)])
(read inp))) (read inp)))
(define (*read-syntax src port) (define (*read-syntax src port)
(parameterize ([current-readtable readtable]) (parameterize ([current-readtable (readtable)])
(read-syntax src port))) (read-syntax src port)))
(provide readtable (rename-out [*read read] [*read-syntax read-syntax])) (provide readtable (rename-out [*read read] [*read-syntax read-syntax]))