commit cda7efa29cc7b23ab6065794d8b15280209fe353
parent cf0f2e3615f725f95f99b80fbdf44ce784c540eb
Author: Ayman Osman <aymano.osman@gmail.com>
Date: Tue, 7 Jul 2020 18:16:01 +0100
handle case of no body forms in lp langauge
Closes racket/scribble#249
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scribble-lib/scribble/lp/lang/common.rkt b/scribble-lib/scribble/lp/lang/common.rkt
@@ -30,7 +30,7 @@
(define-syntax (tangle stx)
(define chunk-mentions '())
(unless first-id
- (raise-syntax-error 'scribble/lp "no chunks"))
+ (raise-no-chunks-error))
(define orig-stx (syntax-case stx () [(_ orig) #'orig]))
(define (restore nstx d) (datum->syntax orig-stx d nstx nstx))
(define (shift nstx) (replace-context orig-stx nstx))
@@ -121,6 +121,7 @@
(define-for-syntax ((make-module-begin submod?) stx)
(syntax-case stx ()
+ [(_) (raise-no-chunks-error)]
[(_ body0 . body)
(let ([expanded
(expand `(,#'module scribble-lp-tmp-name scribble/private/lp
@@ -147,3 +148,6 @@
(define-syntax module-begin/plain (make-module-begin #f))
(define-syntax module-begin/doc (make-module-begin #t))
+
+(define-for-syntax (raise-no-chunks-error)
+ (raise-syntax-error 'scribble/lp "no chunks"))