added a missing error check to scribble decoding

original commit: ecf45ab426b5215a71f31ffb223dfce7cadd66fd
This commit is contained in:
Robby Findler 2011-06-11 08:57:42 -05:00
parent d8f6292e36
commit 027d80e352

View File

@ -189,10 +189,13 @@
(part-to-collect part) (part-to-collect part)
(append para (part-blocks part)) (append para (part-blocks part))
(cons (car l) (part-parts part))))] (cons (car l) (part-parts part))))]
[(and (part-start? (car l)) [(part-start? (car l))
(or (not part-depth) (unless part-depth
((part-start-depth (car l)) . <= . part-depth))) (error 'decode "misplaced part; title: ~s" (part-start-title (car l))))
(unless part-depth (error 'decode "misplaced part: ~e" (car l))) (unless ((part-start-depth (car l)) . <= . part-depth)
(error 'decode
"misplaced part (the part is more than one layer deeper than its container); title: ~s"
(part-start-title (car l))))
(let ([s (car l)]) (let ([s (car l)])
(let loop ([l (cdr l)] [s-accum null]) (let loop ([l (cdr l)] [s-accum null])
(if (or (null? l) (if (or (null? l)