units chapter in guide
svn: r9907 original commit: 5ca718b35e23277adb065a51e1f98732c23a7f5b
This commit is contained in:
parent
892fc9b77d
commit
7f776b01c9
|
@ -4,6 +4,7 @@
|
||||||
scribble/decode
|
scribble/decode
|
||||||
scribble/srcdoc
|
scribble/srcdoc
|
||||||
(for-syntax scheme/base
|
(for-syntax scheme/base
|
||||||
|
scheme/path
|
||||||
syntax/path-spec))
|
syntax/path-spec))
|
||||||
|
|
||||||
(provide include-extracted)
|
(provide include-extracted)
|
||||||
|
@ -28,7 +29,9 @@
|
||||||
(raise-syntax-error #f "expected a literal regular expression as the second argument" stx #'regexp-s))
|
(raise-syntax-error #f "expected a literal regular expression as the second argument" stx #'regexp-s))
|
||||||
(let ([s-exp
|
(let ([s-exp
|
||||||
(parameterize ([current-namespace (make-base-namespace)]
|
(parameterize ([current-namespace (make-base-namespace)]
|
||||||
[read-accept-reader #t])
|
[read-accept-reader #t]
|
||||||
|
[current-load-relative-directory
|
||||||
|
(path-only path)])
|
||||||
(expand
|
(expand
|
||||||
(with-input-from-file path
|
(with-input-from-file path
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
(define-syntax (schememod stx)
|
(define-syntax (schememod stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ lang rest ...)
|
[(_ #:file filename lang rest ...)
|
||||||
(with-syntax ([modtag (datum->syntax
|
(with-syntax ([modtag (datum->syntax
|
||||||
#'here
|
#'here
|
||||||
`(unsyntax (make-element
|
`(unsyntax (make-element
|
||||||
|
@ -60,8 +60,18 @@
|
||||||
(as-modname-link
|
(as-modname-link
|
||||||
',#'lang
|
',#'lang
|
||||||
(to-element ',#'lang)))))
|
(to-element ',#'lang)))))
|
||||||
#'lang)])
|
#'lang)]
|
||||||
#'(schemeblock modtag rest ...))]))
|
[(file ...)
|
||||||
|
(if (syntax-e #'filename)
|
||||||
|
(list
|
||||||
|
(datum->syntax
|
||||||
|
#'filename
|
||||||
|
`(code:comment (unsyntax (t "In \"" ,#'filename "\":")))
|
||||||
|
#'filename))
|
||||||
|
null)])
|
||||||
|
(syntax/loc stx (schemeblock file ... modtag rest ...)))]
|
||||||
|
[(_ lang rest ...)
|
||||||
|
(syntax/loc stx (schememod #:file #f lang rest ...))]))
|
||||||
|
|
||||||
(define (to-element/result s)
|
(define (to-element/result s)
|
||||||
(make-element "schemeresult" (list (to-element/no-color s))))
|
(make-element "schemeresult" (list (to-element/no-color s))))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user