From 94fce663e931ba9e5699c98cf348fd319a48ad6a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 1 Dec 2007 02:47:17 +0000 Subject: [PATCH] more doc fixes svn: r7881 original commit: c9545a836b2f9a7128cf632e2222dbe9d84de8fc --- collects/scribble/scheme.ss | 22 +++++++++++++--------- collects/scribble/struct.ss | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/collects/scribble/scheme.ss b/collects/scribble/scheme.ss index 1b77a0d2..fa97407e 100644 --- a/collects/scribble/scheme.ss +++ b/collects/scribble/scheme.ss @@ -45,14 +45,18 @@ (define-struct (sized-element element) (length)) - (define-struct spaces (pre cnt post)) + (define-struct (spaces element) (cnt)) (define (literalize-spaces i) (let ([m (regexp-match-positions #rx" +" i)]) (if m - (make-spaces (literalize-spaces (substring i 0 (caar m))) - (- (cdar m) (caar m)) - (literalize-spaces (substring i (cdar m)))) + (let ([cnt (- (cdar m) (caar m))]) + (make-spaces #f + (list + (literalize-spaces (substring i 0 (caar m))) + (make-element 'hspace (list (make-string cnt #\space))) + (literalize-spaces (substring i (cdar m)))) + cnt)) i))) (define (typeset-atom c out color? quote-depth) @@ -150,17 +154,17 @@ [(delayed-element? v) (element-width v)] [(spaces? v) - (+ (sz-loop (spaces-pre v)) + (+ (sz-loop (car (element-content v))) (spaces-cnt v) - (sz-loop (spaces-post v)))] + (sz-loop (caddr (element-content v))))] [else 1])))] [(v cls len) (unless (equal? v "") (cond [(spaces? v) - (out (spaces-pre v) cls 0) - (out (make-element 'hspace (list (make-string (spaces-cnt v) #\space))) #f 0) - (out (spaces-post v) cls len)] + (out (car (element-content v)) cls 0) + (out (cadr (element-content v)) #f 0) + (out (caddr (element-content v)) cls len)] [(equal? v "\n") (if multi-line? (begin diff --git a/collects/scribble/struct.ss b/collects/scribble/struct.ss index 06d64c0f..0fbcc685 100644 --- a/collects/scribble/struct.ss +++ b/collects/scribble/struct.ss @@ -66,7 +66,7 @@ (syntax-case stx () [(_ (id ([field ct] ...)) ...) #`(begin - (define-serializable-struct id (field ...) #:mutable) ... + (define-serializable-struct id (field ...)) ... (provide/contract #,@(let ([ids (syntax->list #'(id ...))] [fields+cts (syntax->list #'(([field ct] ...) ...))])