commit aee7b363b4974a8857d1fccc4289fc5a13d39597
parent 6ea98dd621997d079a7bd15c118732648bef8053
Author: Robby Findler <robby@racket-lang.org>
Date: Wed, 25 Feb 2009 15:30:29 +0000
made the special identifier <*> count as main, if it is present
svn: r13833
original commit: 4fd43c7d9a7816bd0b960288234cbd5213b2d710
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/collects/scribble/lp/lang/lang.ss b/collects/scribble/lp/lang/lang.ss
@@ -6,6 +6,7 @@
(require (for-syntax scheme/base syntax/boundmap scheme/list syntax/kerncase))
(begin-for-syntax
+ (define first-id #f)
(define main-id #f)
(define (mapping-get mapping id)
(free-identifier-mapping-get mapping id (lambda () '())))
@@ -16,7 +17,8 @@
(define (get-chunk id)
(map syntax-local-introduce (mapping-get chunks id)))
(define (add-to-chunk! id exprs)
- (unless main-id (set! main-id id))
+ (unless first-id (set! first-id id))
+ (when (eq? (syntax-e id) '<*>) (set! main-id id))
(free-identifier-mapping-put!
chunk-groups id
(cons (syntax-local-introduce id) (mapping-get chunk-groups id)))
@@ -26,8 +28,13 @@
(define-syntax (tangle stx)
(define chunk-mentions '())
+ (define stupid-internal-definition-sytnax
+ (unless main-id
+ (raise-syntax-error 'scribble/lp "no chunks")))
(define body
- (let loop ([block (get-chunk main-id)])
+ (let loop ([block (if main-id
+ (get-chunk main-id)
+ (get-chunk first-id))])
(append-map
(lambda (expr)
(if (identifier? expr)