use some #lang lines
svn: r9173 original commit: 1a5cb7ed64be900f5f5073c5dc7429aaf232a656
This commit is contained in:
parent
9f2c69105d
commit
bc13980309
|
@ -1,4 +1,3 @@
|
||||||
(module reader mzscheme
|
#lang scheme/base
|
||||||
(require (prefix doc: scribble/doc/reader))
|
(require (prefix-in doc: scribble/doc/reader))
|
||||||
(provide (rename doc:read read)
|
(provide (rename-out [doc:read read] [doc:read-syntax read-syntax]))
|
||||||
(rename doc:read-syntax read-syntax)))
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
(module main scheme/base
|
#lang scheme/base
|
||||||
(define-syntax-rule (out)
|
(define-syntax-rule (out)
|
||||||
(begin (require scribble/doclang)
|
(begin (require scribble/doclang)
|
||||||
(provide (all-from-out scribble/doclang))))
|
(provide (all-from-out scribble/doclang))))
|
||||||
(out))
|
(out)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
#lang scheme/base
|
||||||
|
|
||||||
(module reader scheme/base
|
|
||||||
(require (prefix-in scribble: "../reader.ss"))
|
(require (prefix-in scribble: "../reader.ss"))
|
||||||
|
|
||||||
(provide (rename-out [*read read])
|
(provide (rename-out [*read read])
|
||||||
|
@ -19,6 +19,4 @@
|
||||||
'page)]
|
'page)]
|
||||||
[id 'doc])
|
[id 'doc])
|
||||||
`(module ,name scribble/doclang
|
`(module ,name scribble/doclang
|
||||||
(#%module-begin
|
(#%module-begin ,id () . ,body))))
|
||||||
,id ()
|
|
||||||
. ,body)))))
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
#lang scheme/base
|
||||||
|
|
||||||
(module doclang scheme/base
|
|
||||||
(require "struct.ss"
|
(require "struct.ss"
|
||||||
"decode.ss"
|
"decode.ss"
|
||||||
(for-syntax scheme/base
|
(for-syntax scheme/base
|
||||||
|
@ -23,9 +23,9 @@
|
||||||
(define m-id (decode (list . #,(reverse (syntax->list #'(expr ...))))))
|
(define m-id (decode (list . #,(reverse (syntax->list #'(expr ...))))))
|
||||||
(provide m-id))]
|
(provide m-id))]
|
||||||
[(_ m-id exprs . body)
|
[(_ m-id exprs . body)
|
||||||
;; `body' probably starts with lots of string constants;
|
;; `body' probably starts with lots of string constants; it's
|
||||||
;; it's slow to trampoline on every string, so do them
|
;; slow to trampoline on every string, so do them in a batch
|
||||||
;; in a batch here:
|
;; here:
|
||||||
(let loop ([body #'body]
|
(let loop ([body #'body]
|
||||||
[accum null])
|
[accum null])
|
||||||
(syntax-case body ()
|
(syntax-case body ()
|
||||||
|
@ -37,10 +37,9 @@
|
||||||
#`(doc-begin m-id (accum ... . exprs)))]
|
#`(doc-begin m-id (accum ... . exprs)))]
|
||||||
[(body1 . body)
|
[(body1 . body)
|
||||||
(with-syntax ([exprs (append accum #'exprs)])
|
(with-syntax ([exprs (append accum #'exprs)])
|
||||||
(let ([expanded (local-expand #'body1
|
(let ([expanded (local-expand
|
||||||
'module
|
#'body1 'module
|
||||||
(append
|
(append (kernel-form-identifier-list)
|
||||||
(kernel-form-identifier-list)
|
|
||||||
(syntax->list #'(provide
|
(syntax->list #'(provide
|
||||||
require
|
require
|
||||||
#%provide
|
#%provide
|
||||||
|
@ -60,4 +59,4 @@
|
||||||
#%provide))))
|
#%provide))))
|
||||||
#`(begin #,expanded (doc-begin m-id exprs . body))]
|
#`(begin #,expanded (doc-begin m-id exprs . body))]
|
||||||
[_else
|
[_else
|
||||||
#`(doc-begin m-id (#,expanded . exprs) . body)])))]))])))
|
#`(doc-begin m-id (#,expanded . exprs) . body)])))]))]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user