From d33566e09f9ab3e5706d1f36ec3a27a4de3d2ca3 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 21 Feb 2009 13:30:22 +0000 Subject: [PATCH] chat-noir literate small repairs svn: r13765 original commit: 24e4fd407ba20d2eb14cbf1a0ce996e484d4d1d8 --- collects/scribble/lp-include.ss | 12 +++++++++--- collects/scribble/lp/lang/lang.ss | 14 ++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/collects/scribble/lp-include.ss b/collects/scribble/lp-include.ss index 0dc35fb3..2c68e8c1 100644 --- a/collects/scribble/lp-include.ss +++ b/collects/scribble/lp-include.ss @@ -32,12 +32,18 @@ (if (n . > . 1) #'(void) (with-syntax ([tag str] - [str str]) + [str str] + [((for-label-mod ...) ...) + (map (lambda (expr) + (syntax-case expr (require) + [(require mod ...) + #'(mod ...)] + [else null])) + (syntax->list #'(expr ...)))]) #`(begin - ;; ---- This is the new part -------- (define-syntax name (make-element-id-transformer (lambda (stx) #'(chunkref name)))) - ;; ---------------------------------- + (require (for-label for-label-mod ... ...)) (make-splice (list (make-toc-element #f diff --git a/collects/scribble/lp/lang/lang.ss b/collects/scribble/lp/lang/lang.ss index f2559580..7911f772 100644 --- a/collects/scribble/lp/lang/lang.ss +++ b/collects/scribble/lp/lang/lang.ss @@ -68,7 +68,7 @@ chunk-mentions)]) #`(begin body ... (let ([b-id (void)]) b-use) ...))) -(define-syntax (module-begin stx) +(define-syntax (literate-begin stx) (syntax-case stx () [(module-begin expr ...) (with-syntax @@ -98,6 +98,12 @@ #%provide))) (cons expanded (loop (cdr exprs)))] [else (loop (cdr exprs))]))]))]) - #'(#%module-begin - body-code ... - (tangle)))])) + #'(begin + body-code ... + (tangle)))])) + +(define-syntax (module-begin stx) + (syntax-case stx () + [(_ id exprs . body) + #'(#%module-begin + (literate-begin id exprs . body))]))