scribble/base: fix problem with macro-introduced `include-section'
original commit: 4fd0d7454bd6392d97e2c5d1b917de34c13c6c48
This commit is contained in:
parent
41af75965d
commit
10af84fa62
|
@ -118,14 +118,14 @@
|
||||||
(define-syntax (include-section stx)
|
(define-syntax (include-section stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ mod)
|
[(_ mod)
|
||||||
(with-syntax ([mod (syntax-local-introduce #'mod)])
|
(with-syntax ([doc-from-mod (datum->syntax #'mod 'doc)])
|
||||||
(unless (module-path? (syntax->datum #'mod))
|
(unless (module-path? (syntax->datum #'mod))
|
||||||
(raise-syntax-error #f
|
(raise-syntax-error #f
|
||||||
"not a module path"
|
"not a module path"
|
||||||
stx
|
stx
|
||||||
#'mod))
|
#'mod))
|
||||||
#'(begin
|
#'(begin
|
||||||
(require (only-in mod doc))
|
(require (only-in mod [doc-from-mod doc]))
|
||||||
doc))]))
|
doc))]))
|
||||||
|
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#lang scribble/base
|
||||||
|
|
||||||
|
@; Check that a macro-introduced `include-section' works:
|
||||||
|
@(define-syntax-rule (inc) (include-section "diamond.scrbl"))
|
||||||
|
|
||||||
|
@(inc)
|
|
@ -0,0 +1,7 @@
|
||||||
|
1.
|
||||||
|
|
||||||
|
This example checks that @ is not an escape character if we make a
|
||||||
|
reader that uses a different escape character.
|
||||||
|
|
||||||
|
It also makes sure that a non-ASCII character like diamond is ok as an
|
||||||
|
escape character.
|
Loading…
Reference in New Issue
Block a user