summaryrefslogtreecommitdiff
path: root/src/elab_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-04-21 15:19:00 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-04-21 15:19:00 -0400
commit64be34d44a0de6a4710b3bff9feb087df7dcc70c (patch)
tree6640bbfe47f230ce0baa489721bf8dbcee8b0c17 /src/elab_print.sml
parent3b4612facbbf08e12ff983f315d654eb647f7afe (diff)
Omit 'Basis.' in pretty-printing constructors, where this is unambiguous
Diffstat (limited to 'src/elab_print.sml')
-rw-r--r--src/elab_print.sml15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/elab_print.sml b/src/elab_print.sml
index 69607056..c25576ba 100644
--- a/src/elab_print.sml
+++ b/src/elab_print.sml
@@ -165,7 +165,20 @@ fun p_con' par env (c, _) =
else
m1x
in
- p_list_sep (string ".") string (m1x :: ms @ [x])
+ if m1x = "Basis" andalso (case E.lookupC env x of
+ E.Named (n, _) =>
+ let
+ val (_, _, co) = E.lookupCNamed env n
+ in
+ case co of
+ SOME (CModProj (m1', [], x'), _) => m1' = m1 andalso x' = x
+ | _ => false
+ end
+ | E.NotBound => true
+ | _ => false) then
+ string x
+ else
+ p_list_sep (string ".") string (m1s :: ms @ [x])
end
| CApp (c1, c2) => parenIf par (box [p_con env c1,