extend reader for repl too

This commit is contained in:
AlexKnauth 2014-10-29 22:49:25 -04:00
parent 5d3e291c44
commit a8a41e1820
4 changed files with 30 additions and 8 deletions

9
.gitignore vendored
View File

@ -1,10 +1,5 @@
*.scrbl~
*.rkt~
*~
compiled/
*.html
*.css
*.js

View File

@ -0,0 +1,10 @@
#lang racket/base
(provide get-language-info)
(define (get-language-info data)
(lambda (key default)
(case key
[(configure-runtime)
'(#[afl/lang/runtime-config configure #f])]
[else default])))

View File

@ -20,7 +20,12 @@
;; fall back to /lang/reader:
(string->symbol (string-append str "/lang/reader"))))))
wrap-reader
wrap-reader
(lambda (orig-read-syntax)
(define read-syntax (wrap-reader orig-read-syntax))
(lambda args
(syntax-property (apply read-syntax args)
'module-language
'#(afl/lang/language-info get-language-info #f))))
(lambda (proc)
(lambda (key defval)
(define (fallback) (if proc (proc key defval) defval))

View File

@ -0,0 +1,12 @@
#lang racket/base
(provide configure)
(require (only-in afl/reader make-afl-readtable))
(define (configure data)
(define old-read (current-read-interaction))
(define (new-read src in)
(parameterize ([current-readtable (make-afl-readtable (current-readtable))])
(old-read src in)))
(current-read-interaction new-read))