HCoop
/
hcoop
/
domtool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ec55409
)
Make HTML pretty-printing prettier
author
Adam Chlipala
<adamc@hcoop.net>
Sat, 26 May 2007 15:45:48 +0000
(15:45 +0000)
committer
Adam Chlipala
<adamc@hcoop.net>
Sat, 26 May 2007 15:45:48 +0000
(15:45 +0000)
src/htmlPrint.sml
patch
|
blob
|
blame
|
history
diff --git
a/src/htmlPrint.sml
b/src/htmlPrint.sml
index
2018556
..
c752c3f
100644
(file)
--- a/
src/htmlPrint.sml
+++ b/
src/htmlPrint.sml
@@
-95,10
+95,13
@@
fun p_typ' pn (t, _) =
TBase s => typ s
| TList t => dBox [punct "[", p_typ' false t, punct "]"]
| TArrow (t1, t2) =>
TBase s => typ s
| TList t => dBox [punct "[", p_typ' false t, punct "]"]
| TArrow (t1, t2) =>
- parenIf pn [p_typ' true t1, space 1, punct "->", space 1, p_typ'
tru
e t2]
+ parenIf pn [p_typ' true t1, space 1, punct "->", space 1, p_typ'
fals
e t2]
| TAction (p, r1, r2) =>
| TAction (p, r1, r2) =>
- parenIf pn [p_predBoxed p, space 1, p_record r1, space 1,
- punct "=>", space 1, p_record r2]
+ (case (StringMap.numItems r1, StringMap.numItems r2) of
+ (0, 0) => parenIf pn [p_predBoxed p]
+ | (_, 0) => parenIf pn [p_predBoxed p, space 1, p_record r1]
+ | _ => parenIf pn [p_predBoxed p, space 1, p_record r1, space 1,
+ punct "=>", space 1, p_record r2])
| TNested (p, t) =>
parenIf pn [p_pred' false p, space 1, punct "=>", space 1, p_typ' false t]
| TNested (p, t) =>
parenIf pn [p_pred' false p, space 1, punct "=>", space 1, p_typ' false t]