From 10af84fa6206e96a45495af468d136bd518a81f6 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 30 Aug 2013 15:31:47 -0600 Subject: [PATCH] scribble/base: fix problem with macro-introduced `include-section' original commit: 4fd0d7454bd6392d97e2c5d1b917de34c13c6c48 --- pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt | 4 ++-- .../tests/scribble/docs/include-section.scrbl | 6 ++++++ .../scribble-test/tests/scribble/docs/include-section.txt | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.scrbl create mode 100644 pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.txt diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt b/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt index c7413c9e..2e32ea60 100644 --- a/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt +++ b/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt @@ -118,14 +118,14 @@ (define-syntax (include-section stx) (syntax-case stx () [(_ mod) - (with-syntax ([mod (syntax-local-introduce #'mod)]) + (with-syntax ([doc-from-mod (datum->syntax #'mod 'doc)]) (unless (module-path? (syntax->datum #'mod)) (raise-syntax-error #f "not a module path" stx #'mod)) #'(begin - (require (only-in mod doc)) + (require (only-in mod [doc-from-mod doc])) doc))])) ;; ---------------------------------------- diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.scrbl b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.scrbl new file mode 100644 index 00000000..b09b87a2 --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.scrbl @@ -0,0 +1,6 @@ +#lang scribble/base + +@; Check that a macro-introduced `include-section' works: +@(define-syntax-rule (inc) (include-section "diamond.scrbl")) + +@(inc) diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.txt b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.txt new file mode 100644 index 00000000..2da76d86 --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.txt @@ -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.