pull/9/head
Matthew Butterick 11 years ago
parent 776a9f90e8
commit acc990b094

@ -8,7 +8,7 @@
(define-for-syntax (put-file-in-require-form file) (define-for-syntax (put-file-in-require-form file)
`(file ,(path->string file))) `(file ,(path->string file)))
(define-for-syntax (make-require-extras-syntax stx #:provide? [provide? #f]) (define-for-syntax (do-project-require-file-syntax stx #:provide? [provide? #f])
(define project-require-files (get-project-require-files)) (define project-require-files (get-project-require-files))
(if project-require-files (if project-require-files
(let ([files-in-require-form (map put-file-in-require-form project-require-files)]) (let ([files-in-require-form (map put-file-in-require-form project-require-files)])
@ -20,11 +20,11 @@
; if no files to import, do nothing ; if no files to import, do nothing
#'(begin))) #'(begin)))
(define-syntax (require-and-provide-extras stx) (define-syntax (require-and-provide-project-require-files stx)
(make-require-extras-syntax stx #:provide? #t)) (do-project-require-file-syntax stx #:provide? #t))
(define-syntax (require-extras stx) (define-syntax (require-project-require-files stx)
(make-require-extras-syntax stx)) (do-project-require-file-syntax stx))
;; here = path of this file, relative to current directory. ;; here = path of this file, relative to current directory.

@ -1,16 +1,16 @@
#lang racket/base #lang racket/base
(provide (except-out (all-from-out racket/base) #%module-begin) (provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [module-begin #%module-begin])) (rename-out [replacement-module-begin #%module-begin]))
(define-syntax-rule (module-begin body ...) (define-syntax-rule (replacement-module-begin body ...)
(#%module-begin (#%module-begin
(module inner pollen/lang/doclang_raw (module inner pollen/lang/doclang_raw
main main
(λ(x) (apply string-append (cdr x))) ;; chop first linebreak with cdr (λ(x) (apply string-append (cdr x))) ;; chop first linebreak with cdr
() ()
(require pollen/main-helper pollen/top) (require pollen/main-helper)
(require-and-provide-extras) (require-project-require-files)
(provide (all-defined-out)) (provide (all-defined-out))
body ...) body ...)

Loading…
Cancel
Save