module-lang-ify reader

Matthew Butterick 9 years ago
parent d000142770
commit b8d050bbe8

@ -3,6 +3,5 @@
(define+provide-module-begin-in-mode default-mode-preproc) ; because default mode in submodule is preproc (define+provide-module-begin-in-mode default-mode-preproc) ; because default mode in submodule is preproc
(module reader racket/base (module reader "private/reader-base.rkt"
(require pollen/private/reader-base) default-mode-auto)
(define+provide-reader-in-mode default-mode-auto)) ; because default mode in file is auto

@ -3,6 +3,5 @@
(define+provide-module-begin-in-mode default-mode-markdown) (define+provide-module-begin-in-mode default-mode-markdown)
(module reader racket/base (module reader "private/reader-base.rkt"
(require pollen/private/reader-base) default-mode-markdown)
(define+provide-reader-in-mode default-mode-markdown))

@ -3,6 +3,5 @@
(define+provide-module-begin-in-mode default-mode-markup) (define+provide-module-begin-in-mode default-mode-markup)
(module reader racket/base (module reader "private/reader-base.rkt"
(require pollen/private/reader-base) default-mode-markup)
(define+provide-reader-in-mode default-mode-markup))

@ -3,6 +3,5 @@
(define+provide-module-begin-in-mode default-mode-preproc) (define+provide-module-begin-in-mode default-mode-preproc)
(module reader racket/base (module reader "private/reader-base.rkt"
(require pollen/private/reader-base) default-mode-preproc)
(define+provide-reader-in-mode default-mode-preproc))

@ -1,7 +1,7 @@
#lang racket/base #lang racket/base
(require racket/syntax syntax/strip-context racket/class (for-syntax racket/base racket/syntax)) (require racket/syntax syntax/strip-context racket/class (for-syntax racket/base racket/syntax))
(require (only-in scribble/reader make-at-reader) "../setup.rkt" "project.rkt" racket/function) (require (only-in scribble/reader make-at-reader) "../setup.rkt" "project.rkt" racket/function)
(provide define+provide-reader-in-mode (all-from-out "../setup.rkt")) (provide (rename-out [reader-module-begin #%module-begin]) (all-from-out "../setup.rkt"))
(define current-reader-mode (make-parameter #f)) (define current-reader-mode (make-parameter #f))
@ -81,13 +81,13 @@
(my-make-drracket-buttons my-command-char)])] (my-make-drracket-buttons my-command-char)])]
[else default])))) [else default]))))
(define-syntax (define+provide-reader-in-mode stx) (define-syntax (reader-module-begin stx)
(syntax-case stx () (syntax-case stx ()
[(_ mode) [(_ mode expr-to-ignore ...)
(with-syntax ([cr (generate-temporary)] (with-syntax ([cr (generate-temporary)]
[crs (generate-temporary)] [crs (generate-temporary)]
[cgi (generate-temporary)]) [cgi (generate-temporary)])
#'(begin #'(#%module-begin
(current-reader-mode mode) (current-reader-mode mode)
(define cgi custom-get-info) (define cgi custom-get-info)
(define cr custom-read) (define cr custom-read)

@ -3,6 +3,5 @@
(define+provide-module-begin-in-mode default-mode-pagetree) (define+provide-module-begin-in-mode default-mode-pagetree)
(module reader racket/base (module reader "private/reader-base.rkt"
(require pollen/private/reader-base) default-mode-pagetree)
(define+provide-reader-in-mode default-mode-pagetree))

Loading…
Cancel
Save