- External mod -> pprExternal sty name uniq mod occ
- System -> pprSystem sty uniq occ
- Internal -> pprInternal sty uniq occ
-
-pprExternal sty name uniq mod occ
- | codeStyle sty = ppr (moduleName mod) <> char '_' <> pprOccName occ
-
- | debugStyle sty = ppr (moduleName mod) <> dot <> pprOccName occ <>
- text "{-" <> pprUnique uniq <> text "-}"
-
- | unqualStyle sty name = pprOccName occ
- | otherwise = ppr (moduleName mod) <> dot <> pprOccName occ
+ WiredIn mod _ _ BuiltInSyntax -> pprOccName occ -- Built-in syntax is never qualified
+ WiredIn mod _ _ UserSyntax -> pprExternal sty uniq mod occ True
+ External mod _ -> pprExternal sty uniq mod occ False
+ System -> pprSystem sty uniq occ
+ Internal -> pprInternal sty uniq occ
+
+pprExternal sty uniq mod occ is_wired
+ | unqualStyle sty mod_name occ = pprOccName occ
+ | codeStyle sty = ppr mod_name <> char '_' <> pprOccName occ
+ | debugStyle sty = sep [ppr mod_name <> dot <> pprOccName occ,
+ hsep [text "{-"
+ , if is_wired then ptext SLIT("(w)") else empty
+ , pprUnique uniq
+-- (overkill) , case mb_p of
+-- Nothing -> empty
+-- Just n -> brackets (ppr n)
+ , text "-}"]]
+ | otherwise = ppr mod_name <> dot <> pprOccName occ
+ where
+ mod_name = moduleName mod