simplify lang modules

pull/9/head
Matthew Butterick 11 years ago
parent 88251d9a07
commit 978a910b74

@ -3,11 +3,14 @@
(provide (all-defined-out) (all-from-out pollen/world)) (provide (all-defined-out) (all-from-out pollen/world))
(define-syntax (make-new-module-begin stx) (define-syntax (define+provide-new-module-begin stx)
(syntax-case stx () (syntax-case stx ()
[(_ mode-arg) [(_ mode-arg)
(with-syntax ([new-module-begin (format-id stx "new-module-begin")]) (with-syntax ([new-module-begin (format-id stx "new-module-begin")])
#'(define-syntax (new-module-begin stx-arg) #'(begin
(provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [new-module-begin #%module-begin]))
(define-syntax (new-module-begin stx-arg)
(syntax-case stx-arg () (syntax-case stx-arg ()
[(_ body-exprs (... ...)) [(_ body-exprs (... ...))
(syntax-protect (syntax-protect
@ -98,4 +101,4 @@
(module+ main (module+ main
(if (equal? parser-mode world:mode-preproc) (if (equal? parser-mode world:mode-preproc)
(display doc) (display doc)
(print doc)))))])))])) (print doc)))))]))))]))

@ -1,7 +1,3 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-new-module-begin world:mode-preproc)
(provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [new-module-begin #%module-begin]))
(make-new-module-begin world:mode-preproc)

@ -1,7 +1,3 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-new-module-begin world:mode-markdown)
(provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [new-module-begin #%module-begin]))
(make-new-module-begin world:mode-markdown)

@ -1,7 +1,3 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-new-module-begin world:mode-markup)
(provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [new-module-begin #%module-begin]))
(make-new-module-begin world:mode-markup)

@ -1,7 +1,3 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-new-module-begin world:mode-preproc)
(provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [new-module-begin #%module-begin]))
(make-new-module-begin world:mode-preproc)

@ -1,7 +1,3 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-new-module-begin world:mode-pagetree)
(provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [new-module-begin #%module-begin]))
(make-new-module-begin world:mode-pagetree)
Loading…
Cancel
Save