From c63cd9a943cf09fe128519d08d530abf1c072fca Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 22 Jan 2008 14:54:37 +0000 Subject: [PATCH] fix eval:alts to not add context svn: r8383 original commit: b7a19fdc4a19e7f62a6f47f05e4ea32b6d97b98b --- collects/scribble/eval.ss | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/collects/scribble/eval.ss b/collects/scribble/eval.ss index 8c790915..441ed8d4 100644 --- a/collects/scribble/eval.ss +++ b/collects/scribble/eval.ss @@ -124,14 +124,21 @@ (cdr val-list+outputs) #f))))))) + (define (extract s . ops) + (let loop ([s s][ops ops]) + (cond + [(null? ops) s] + [(syntax? s) (loop (syntax-e s) ops)] + [else (loop ((car ops) s) (cdr ops))]))) + (define ((do-eval ev) s) (syntax-case s (code:comment eval:alts) [(code:line v (code:comment . rest)) - ((do-eval ev) #'v)] + ((do-eval ev) (extract s cdr car))] [(code:comment . rest) (list (list (void)) "" "")] [(eval:alts p e) - ((do-eval ev) #'e)] + ((do-eval ev) (extract s cdr cdr car))] [else (with-handlers ([exn:fail? (lambda (e) (list (exn-message e)