strengthen contract on blockss field of table struct in scribble

This commit is contained in:
Robby Findler 2012-06-22 22:12:54 -05:00
parent 6588493810
commit f7185bec91
2 changed files with 9 additions and 2 deletions

View File

@ -135,6 +135,12 @@
(and (string? s)
(not (regexp-match? #rx"\n" s))))
(define (same-lengths? ls)
(or (null? ls)
(let ([l1 (length (car ls))])
(andmap (λ (l) (= l1 (length l)))
(cdr ls)))))
(provide-structs
[part ([tag-prefix (or/c false/c string?)]
[tags (listof tag?)]
@ -146,7 +152,8 @@
[paragraph ([style style?]
[content content?])]
[table ([style style?]
[blockss (listof (listof (or/c block? (one-of/c 'cont))))])]
[blockss (and/c (listof (listof (or/c block? (one-of/c 'cont))))
same-lengths?)])]
[delayed-block ([resolve (any/c part? resolve-info? . -> . block?)])]
[itemization ([style style?]
[blockss (listof (listof block?))])]

View File

@ -76,7 +76,7 @@
#f
(append
(if super-long?
(list (list (to-flow ret) 'cont 'cont 'cont 'cont))
(list (list (to-flow ret) 'cont 'cont))
null)
(list
(append