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