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
(module reader racket/base
(require pollen/private/reader-base)
(define+provide-reader-in-mode default-mode-auto)) ; because default mode in file is auto
(module reader "private/reader-base.rkt"
default-mode-auto)

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

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

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

@ -1,7 +1,7 @@
#lang racket/base
(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)
(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))
@ -81,13 +81,13 @@
(my-make-drracket-buttons my-command-char)])]
[else default]))))
(define-syntax (define+provide-reader-in-mode stx)
(define-syntax (reader-module-begin stx)
(syntax-case stx ()
[(_ mode)
[(_ mode expr-to-ignore ...)
(with-syntax ([cr (generate-temporary)]
[crs (generate-temporary)]
[cgi (generate-temporary)])
#'(begin
#'(#%module-begin
(current-reader-mode mode)
(define cgi custom-get-info)
(define cr custom-read)

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

Loading…
Cancel
Save