comparison src/elab_print.sml @ 1721:5df85275c0d4

Omit 'Basis.' in pretty-printing constructors, where this is unambiguous
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Apr 2012 15:19:00 -0400
parents 30c0ca20bf59
children 318ba997a149
comparison
equal deleted inserted replaced
1720:30c0ca20bf59 1721:5df85275c0d4
163 val m1s = if !debug then 163 val m1s = if !debug then
164 m1x ^ "__" ^ Int.toString m1 164 m1x ^ "__" ^ Int.toString m1
165 else 165 else
166 m1x 166 m1x
167 in 167 in
168 p_list_sep (string ".") string (m1x :: ms @ [x]) 168 if m1x = "Basis" andalso (case E.lookupC env x of
169 E.Named (n, _) =>
170 let
171 val (_, _, co) = E.lookupCNamed env n
172 in
173 case co of
174 SOME (CModProj (m1', [], x'), _) => m1' = m1 andalso x' = x
175 | _ => false
176 end
177 | E.NotBound => true
178 | _ => false) then
179 string x
180 else
181 p_list_sep (string ".") string (m1s :: ms @ [x])
169 end 182 end
170 183
171 | CApp (c1, c2) => parenIf par (box [p_con env c1, 184 | CApp (c1, c2) => parenIf par (box [p_con env c1,
172 space, 185 space,
173 p_con' true env c2]) 186 p_con' true env c2])