|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
(only-in xml xexpr/c)
|
|
|
|
|
(prefix-in core: hyphenate/private/core))
|
|
|
|
|
|
|
|
|
|
(provide build-main)
|
|
|
|
|
(provide (rename-out [mb #%module-begin]) #%top-interaction #%top #%datum #%app)
|
|
|
|
|
|
|
|
|
|
;; An exception-word is a string of word characters or hyphens.
|
|
|
|
|
(define (exception-word? x)
|
|
|
|
@ -53,17 +53,19 @@
|
|
|
|
|
(write-to-file (dynamic-require module-path id-sym) cache-path #:exists 'replace))
|
|
|
|
|
(file->value cache-path))
|
|
|
|
|
|
|
|
|
|
(define-syntax (build-main stx)
|
|
|
|
|
(define-syntax (mb stx)
|
|
|
|
|
(syntax-case stx ()
|
|
|
|
|
[(_ DIR)
|
|
|
|
|
(let ([dir (symbol->string (syntax->datum #'DIR))])
|
|
|
|
|
(with-syntax ([PATTERNS-PATH (path->string (build-path dir "patterns.rkt"))]
|
|
|
|
|
(let* ([base (let-values ([(base name _) (split-path (syntax-source stx))])
|
|
|
|
|
base)]
|
|
|
|
|
[dir (build-path base (symbol->string (syntax->datum #'DIR)))])
|
|
|
|
|
(with-syntax ([PATTERNS-PATH (build-path dir "patterns.rkt")]
|
|
|
|
|
[PATTERN-CACHE-PATH (build-path dir "compiled" "patterns-cache.rktd")]
|
|
|
|
|
[EXCEPTIONS-PATH (path->string (build-path dir "exceptions.rkt"))]
|
|
|
|
|
[EXCEPTIONS-PATH (build-path dir "exceptions.rkt")]
|
|
|
|
|
[EXCEPTIONS-CACHE-PATH (build-path dir "compiled" "exceptions-cache.rktd")]
|
|
|
|
|
[PATTERNS-ID 'patterns]
|
|
|
|
|
[EXCEPTIONS-ID 'exceptions])
|
|
|
|
|
#'(begin
|
|
|
|
|
#'(#%module-begin
|
|
|
|
|
(define PATTERNS-ID (load-from-cache-if-possible PATTERNS-PATH PATTERN-CACHE-PATH 'PATTERNS-ID))
|
|
|
|
|
;; a file-cached hash is immutable, so convert it
|
|
|
|
|
(define EXCEPTIONS-ID (make-hash (hash->list (load-from-cache-if-possible EXCEPTIONS-PATH EXCEPTIONS-CACHE-PATH 'EXCEPTIONS-ID))))
|
|
|
|
|