generalize cache activities
parent
5de6888d42
commit
d6f2ca9ec7
@ -1,18 +1,21 @@
|
||||
#lang racket/base
|
||||
(require racket/string racket/list hyphenate/private/core)
|
||||
(provide (rename-out [emb #%module-begin]) #%app #%datum #%top-interaction)
|
||||
|
||||
(module reader racket/base
|
||||
(require racket/port syntax/strip-context)
|
||||
(provide (rename-out [exception-prep-read read]
|
||||
[exception-prep-read-syntax read-syntax]))
|
||||
|
||||
(define (exception-prep-read in)
|
||||
(syntax->datum (exception-prep-read-syntax #f in)))
|
||||
(define-syntax-rule (emb STRS)
|
||||
(#%module-begin
|
||||
(provide exceptions)
|
||||
(define exceptions (for/hash ([str (in-list (list . STRS))])
|
||||
(define key+val (exception-word->word+pattern str))
|
||||
(values (first key+val) (second key+val))))
|
||||
(module+ main exceptions)))
|
||||
|
||||
(module+ reader
|
||||
(require racket/port)
|
||||
(provide (rename-out [exception-prep-read-syntax read-syntax]))
|
||||
|
||||
(define (exception-prep-read-syntax src in)
|
||||
(with-syntax ([str (port->string in)])
|
||||
(strip-context
|
||||
#'(module exception-prep racket/base
|
||||
(require racket/string racket/list hyphenate/private/core)
|
||||
(provide exceptions)
|
||||
(define exceptions
|
||||
(make-hash (map (λ(xs) (apply cons xs)) (map exception-word->word+pattern (string-split str))))))))))
|
||||
(with-syntax ([STRS (string-split (port->string in))])
|
||||
(syntax->datum
|
||||
#'(module exception-prep hyphenate/private/exception-prep
|
||||
STRS)))))
|
Loading…
Reference in New Issue