reformat using #lang

svn: r14103

original commit: eb62b52d3af646a32eb842087c91743bdb815f94
This commit is contained in:
Eli Barzilay 2009-03-15 01:06:57 +00:00
parent 7d488fa96b
commit 208edf6016

View File

@ -1,5 +1,5 @@
#lang scheme/base
(module utils scheme/base
(require scribble/struct
scribble/manual
(prefix-in scheme: scribble/scheme)
@ -8,11 +8,9 @@
(define-syntax bounce-for-label
(syntax-rules (all-except)
[(_ (all-except mod (id ...) (id2 ...)))
(begin
(require (for-label (except-in mod id ...)))
(begin (require (for-label (except-in mod id ...)))
(provide (for-label (except-out (all-from-out mod) id2 ...))))]
[(_ mod) (begin
(require (for-label mod))
[(_ mod) (begin (require (for-label mod))
(provide (for-label (all-from-out mod))))]
[(_ mod ...) (begin (bounce-for-label mod) ...)]))
@ -34,40 +32,30 @@
(make-table
#f
(map (lambda (s)
(list (make-flow (list (make-paragraph
(if (string=? s "")
(let ([line (if (string=? s "")
'(nbsp) ; needed for IE
(list (litchar s))))))))
(list (litchar s)))])
(list (make-flow (list (make-paragraph line))))))
strs)))))
(define (as-flow e)
(make-flow (list (if (block? e)
e
(make-paragraph (list e))))))
(make-flow (list (if (block? e) e (make-paragraph (list e))))))
(define spacer (hspace 2))
(define ((norm-spacing base) p)
(cond
[(and (syntax->list p)
(not (null? (syntax-e p))))
(cond [(and (syntax->list p) (not (null? (syntax-e p))))
(let loop ([e (syntax->list p)]
[line (syntax-line (car (syntax-e p)))]
[pos base]
[second #f]
[accum null])
(cond
[(null? e)
(if (null? e)
(datum->syntax
p
(reverse accum)
(list (syntax-source p)
(syntax-line p)
base
(add1 base)
p (reverse accum)
(list (syntax-source p) (syntax-line p) base (add1 base)
(- pos base))
p)]
[else
p)
(let* ([v ((norm-spacing (if (= line (syntax-line (car e)))
pos
(or second pos)))
@ -77,16 +65,10 @@
(syntax-line v)
next-pos
(or second next-pos)
(cons v accum)))]))]
[else
(datum->syntax
p
(syntax-e p)
(list (syntax-source p)
(syntax-line p)
base
(add1 base)
1)
(cons v accum)))))]
[else (datum->syntax
p (syntax-e p)
(list (syntax-source p) (syntax-line p) base (add1 base) 1)
p)]))
(define (scribble-examples . lines)
@ -117,4 +99,4 @@
"")]
[reads-as (if x reads-as "")])
(map as-flow (list spacer @expr reads-as sexpr))))
r)))))))))
r))))))))