pull/218/head
Matthew Butterick 5 years ago
parent 7534f32dac
commit b242eb11dc

@ -18,9 +18,9 @@
(define ((make-parse-proc parser-mode root-proc) xs) (define ((make-parse-proc parser-mode root-proc) xs)
(define (stringify xs) (apply string-append (map to-string xs))) (define (stringify xs) (apply string-append (map to-string xs)))
(match parser-mode (match parser-mode
[(== default-mode-pagetree) (decode-pagetree xs)] [(== default-mode-pagetree eq?) (decode-pagetree xs)]
[(== default-mode-markup) (apply root-proc (remove-voids xs))] [(== default-mode-markup eq?) (apply root-proc (remove-voids xs))]
[(== default-mode-markdown) [(== default-mode-markdown eq?)
(let* ([xs (stringify xs)] (let* ([xs (stringify xs)]
[xs ((dynamic-require 'markdown 'parse-markdown) xs)] [xs ((dynamic-require 'markdown 'parse-markdown) xs)]
[xs (map strip-empty-attrs xs)]) [xs (map strip-empty-attrs xs)])

@ -20,11 +20,11 @@
(define (infer-parser-mode reader-mode reader-here-path) (define (infer-parser-mode reader-mode reader-here-path)
(match reader-mode (match reader-mode
[(== default-mode-auto) [(== default-mode-auto eq?)
(match (cond [(get-ext reader-here-path) => string->symbol]) (match (cond [(get-ext reader-here-path) => string->symbol])
[(== (setup:pagetree-source-ext)) default-mode-pagetree] [(== (setup:pagetree-source-ext) eq?) default-mode-pagetree]
[(== (setup:markup-source-ext)) default-mode-markup] [(== (setup:markup-source-ext) eq?) default-mode-markup]
[(== (setup:markdown-source-ext)) default-mode-markdown] [(== (setup:markdown-source-ext) eq?) default-mode-markdown]
[_ default-mode-preproc])] [_ default-mode-preproc])]
[_ reader-mode])) [_ reader-mode]))
@ -115,11 +115,11 @@
[(drracket:default-extension) [(drracket:default-extension)
(symbol->string (symbol->string
(match mode (match mode
[(== default-mode-auto) (setup:preproc-source-ext)] [(== default-mode-auto eq?) (setup:preproc-source-ext)]
[(== default-mode-preproc) (setup:preproc-source-ext)] [(== default-mode-preproc eq?) (setup:preproc-source-ext)]
[(== default-mode-markdown) (setup:markdown-source-ext)] [(== default-mode-markdown eq?) (setup:markdown-source-ext)]
[(== default-mode-markup) (setup:markup-source-ext)] [(== default-mode-markup eq?) (setup:markup-source-ext)]
[(== default-mode-pagetree) (setup:pagetree-source-ext)]))] [(== default-mode-pagetree eq?) (setup:pagetree-source-ext)]))]
[else default]))) [else default])))
(define-syntax-rule (reader-module-begin mode . _) (define-syntax-rule (reader-module-begin mode . _)

@ -1 +1 @@
1578803070 1578804970

Loading…
Cancel
Save