From f907f59b32a2a090b96b618098f54ed76fbcfbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Thu, 23 Jun 2016 21:19:24 +0200 Subject: [PATCH] Fixed bug introduced by last commit. --- private/common.rkt | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/private/common.rkt b/private/common.rkt index 66e7b776..283faddb 100644 --- a/private/common.rkt +++ b/private/common.rkt @@ -183,26 +183,28 @@ ;#`(#,(syntax/loc #'lang #%module-begin) …) #`(#,(namespace-symbol->identifier '#%module-begin) tngl - #,@(maybe-insert-doc-submod submod? lang-sym)))])))])) -(define-for-syntax (maybe-insert-doc-submod submod? lang-sym) - (if submod? - (list - (let ([submod - (strip-context - #`(module doc scribble/doclang2 - (define-syntax-rule (if-preexpanding a b) b) - (define-syntax-rule (when-preexpanding . b) (begin)) - (define-syntax-rule (unless-preexpanding . b) (begin . b)) - (require scribble/manual - (only-in hyper-literate/private/lp - chunk - CHUNK) - (for-label #,lang-sym)) - (begin body0 . body)))]) - (syntax-case submod () - [(_ . rest) - (datum->syntax #'here (cons #'module* #'rest))]))) - '())) + #,@(if submod? + (list + (let ([submod + (strip-context + #`(module doc scribble/doclang2 + (define-syntax-rule (if-preexpanding a b) + b) + (define-syntax-rule (when-preexpanding . b) + (begin)) + (define-syntax-rule + (unless-preexpanding . b) + (begin . b)) + (require scribble/manual + (only-in hyper-literate/private/lp + chunk + CHUNK) + (for-label #,lang-sym)) + (begin body0 . body)))]) + (syntax-case submod () + [(_ . rest) + (datum->syntax #'here (cons #'module* #'rest))]))) + '())))])))])) (define-syntax module-begin/plain (make-module-begin #f)) (define-syntax module-begin/doc (make-module-begin #t))