experiment

works
Matthew Butterick 9 years ago
parent 1780e77dcf
commit db46a175b5

@ -1,7 +1,5 @@
#lang racket/base
(require "private/main-base.rkt")
(define+provide-module-begin-in-mode default-mode-preproc) ; because default mode in submodule is preproc
(module main "private/main-base.rkt"
default-mode-preproc
(module reader "private/reader-base.rkt"
default-mode-auto)
default-mode-auto))

@ -1,7 +1,5 @@
#lang racket/base
(require "private/main-base.rkt")
(define+provide-module-begin-in-mode default-mode-markdown)
(module markdown "private/main-base.rkt"
default-mode-markdown
(module reader "private/reader-base.rkt"
default-mode-markdown)
default-mode-markdown))

@ -1,7 +1,5 @@
#lang racket/base
(require "private/main-base.rkt")
(define+provide-module-begin-in-mode default-mode-markup)
(module markup "private/main-base.rkt"
default-mode-markup
(module reader "private/reader-base.rkt"
default-mode-markup)
default-mode-markup))

@ -1,7 +1,5 @@
#lang racket/base
(require "private/main-base.rkt")
(define+provide-module-begin-in-mode default-mode-preproc)
(module pre "private/main-base.rkt"
default-mode-preproc
(module reader "private/reader-base.rkt"
default-mode-preproc)
default-mode-preproc))

@ -1,10 +1,14 @@
#lang racket/base
(require (for-syntax racket/base syntax/strip-context racket/syntax "../setup.rkt" "split-metas.rkt")
"to-string.rkt" "../pagetree.rkt" "splice.rkt" "../setup.rkt" ) ; need world here to resolve PARSER-MODE-ARG
(provide (all-defined-out))
"to-string.rkt" "../pagetree.rkt" "splice.rkt" "../setup.rkt")
(require "../setup.rkt")
(provide (except-out (all-from-out racket/base) #%module-begin)
(all-from-out "../setup.rkt")
(rename-out [dialect-module-begin #%module-begin]))
(define-syntax-rule (define+provide-module-begin-in-mode PARSER-MODE-ARG)
(define-syntax-rule (make-pollen-module-begin PARSER-MODE-IN)
(begin
(require racket/base)
(provide (except-out (all-from-out racket/base) #%module-begin)
(rename-out [pollen-module-begin #%module-begin]))
(define-syntax (pollen-module-begin stx)
@ -40,7 +44,7 @@
(define DOC
(let* ([parser-mode-undefined? (procedure? inner:parser-mode)] ; if undefined, #%top makes it a procedure
[parser-mode (if parser-mode-undefined? PARSER-MODE-ARG inner:parser-mode)]
[parser-mode (if parser-mode-undefined? PARSER-MODE-IN inner:parser-mode)]
[proc (cond
[(eq? parser-mode 'MODE-PAGETREE) decode-pagetree]
[(eq? parser-mode 'MODE-MARKUP) (λ(xs) (apply ROOT xs))] ; if `root` undefined, it becomes a default tag function
@ -52,4 +56,9 @@
[doc-elements-spliced (splice doc-elements 'SPLICING_TAG)])
(proc doc-elements-spliced)))
(provide DOC METAS (except-out (all-from-out 'inner) DOC-RAW #%top))))))])))) ; hide internal exports
(provide DOC METAS (except-out (all-from-out 'inner) DOC-RAW #%top))))))]))))
(define-syntax-rule (dialect-module-begin MODE EXPR ...)
(#%module-begin
(make-pollen-module-begin MODE)
EXPR ...))

@ -1,7 +1,5 @@
#lang racket/base
(require "private/main-base.rkt")
(define+provide-module-begin-in-mode default-mode-pagetree)
(module ptree "private/main-base.rkt"
default-mode-pagetree
(module reader "private/reader-base.rkt"
default-mode-pagetree)
default-mode-pagetree))

Loading…
Cancel
Save