Get External Core (-fext-core) working with readline
[ghc-hetmet.git] / compiler / coreSyn / PprExternalCore.lhs
index 29451d0..502c268 100644 (file)
@@ -1,13 +1,14 @@
 %
-% (c) The University of Glasgow 2001
+% (c) The University of Glasgow 2001-2006
 %
-\begin{code}
 
+\begin{code}
 module PprExternalCore () where
 
 import Pretty
 import ExternalCore
 import Char
+import Encoding
 
 instance Show Module where
   showsPrec d m = shows (pmodule m)
@@ -59,10 +60,10 @@ pcdef (Constr dcon tbinds tys)  =
 pcdef (GadtConstr dcon ty)  =
   (pname dcon) <+> text "::" <+> pty ty
 
-pname id = text id
+pname id = text (zEncodeString id)
 
 pqname ("",id) = pname id
-pqname (m,id)  = pname m <> char '.' <> pname id
+pqname (m,id)  = text m <> char '.' <> pname id
 
 ptbind (t,Klifted) = pname t
 ptbind (t,k) = parens (pname t <> text "::" <> pkind k)
@@ -131,9 +132,11 @@ pexp (Let vd e) = (text "%let" <+> pvdefg vd) $$ (text "%in" <+> pexp e)
 pexp (Case e vb ty alts) = sep [text "%case" <+> parens (paty ty) <+> paexp e,
                             text "%of" <+> pvbind vb]
                        $$ (indent (braces (vcat (punctuate (char ';') (map palt alts)))))
-pexp (Coerce t e) = (text "%coerce" <+> paty t) $$ pexp e
+pexp (Cast e co) = (text "%cast" <+> pexp e) $$ paty co
 pexp (Note s e) = (text "%note" <+> pstring s) $$ pexp e
-pexp (External n t) = (text "%external" <+> pstring n) $$ paty t
+pexp (External n cc t) = (text "%external" <+> text cc <+> pstring n) $$ paty t
+pexp (DynExternal cc t) = (text "%dynexternal" <+> text cc) $$ paty t
+pexp (Label n) = (text "%label" <+> pstring n)
 pexp e = pfexp e