Mercurial > urweb
diff src/print.sml @ 3:daa4f1d7a663
Elaborating cons and decls
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 26 Jan 2008 15:26:12 -0500 |
parents | 4202f6eda946 |
children | 258261a53842 |
line wrap: on
line diff
--- a/src/print.sml Sat Jan 26 14:27:33 2008 -0500 +++ b/src/print.sml Sat Jan 26 15:26:12 2008 -0500 @@ -71,7 +71,27 @@ val preface = fpreface out val epreface = fpreface err -fun fprefaces f ls = +fun fprefaces f s ls = + let + val len = foldl (fn ((s, _), best) => + Int.max (size s, best)) 0 ls + in + fprint f (PD.string s); + fprint f PD.newline; + app (fn (s, d) => + let + val s = CharVector.tabulate (len - size s, + fn _ => #" ") + ^ s ^ ": " + in + fpreface f (s, d) + end) ls + end + +val prefaces = fprefaces out +val eprefaces = fprefaces err + +fun fprefaces' f ls = let val len = foldl (fn ((s, _), best) => Int.max (size s, best)) 0 ls @@ -86,7 +106,7 @@ end) ls end -val prefaces = fprefaces out -val eprefaces = fprefaces err +val prefaces' = fprefaces' out +val eprefaces' = fprefaces' err end