macro-stepper: avoid too-long labels in hiding policy display

original commit: 9f3ac8648891774d723ff46d261c168e10f7b5bd
This commit is contained in:
Ryan Culpepper 2010-12-15 19:13:43 -07:00
parent e6d3233f0c
commit 4e329ad758

View File

@ -252,11 +252,17 @@ TODO
;; ----
(define (policy->string policy)
(string-limit 200
(string-append
(case (car policy)
((show-if) "show ")
((hide-if) "hide "))
(condition->string (cadr policy))))
(condition->string (cadr policy)))))
(define (string-limit size s)
(cond [(> (string-length s) size)
(string-append (substring s 0 (- size 3)) "...")]
[else s]))
(define (condition->string condition)
(match condition