X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcoreSyn%2FPprExternalCore.lhs;h=871f43cb4326db5ba4039f4141dc688323a694b4;hb=98744cef7b82e7eefbb1c6f1d8b9e28c415939c4;hp=c7e51e3c860a35ae338e0bcb187edcb5807ae236;hpb=a3837710367a206fa63fe82ae0d269f424fd2dcf;p=ghc-hetmet.git diff --git a/ghc/compiler/coreSyn/PprExternalCore.lhs b/ghc/compiler/coreSyn/PprExternalCore.lhs index c7e51e3..871f43c 100644 --- a/ghc/compiler/coreSyn/PprExternalCore.lhs +++ b/ghc/compiler/coreSyn/PprExternalCore.lhs @@ -3,7 +3,7 @@ % \begin{code} -module PprExternalCore where +module PprExternalCore () where import Pretty import ExternalCore @@ -39,24 +39,17 @@ instance Show Lit where indent = nest 2 -pmodule (Module mname {- (texports,dexports,vexports) -} tdefs vdefs) = +pmodule (Module mname tdefs vdefgs) = (text "%module" <+> text mname) -{- $$ indent (parens (((fsep (map pname texports) <> char ',') - $$ (fsep (map pname dexports) <> char ',') - $$ (fsep (map pname vexports)))) --} $$ indent ((vcat (map ((<> char ';') . ptdef) tdefs)) - $$ (vcat (map ((<> char ';') . pgvdef) vdefs))) - -pgvdef (False,vdef) = text "%local" <+> pvdefg vdef -pgvdef (True,vdef) = pvdefg vdef + $$ (vcat (map ((<> char ';') . pvdefg) vdefgs))) ptdef (Data tcon tbinds cdefs) = - (text "%data" <+> pname tcon <+> (hsep (map ptbind tbinds)) <+> char '=') + (text "%data" <+> pqname tcon <+> (hsep (map ptbind tbinds)) <+> char '=') $$ indent (braces ((vcat (punctuate (char ';') (map pcdef cdefs))))) ptdef (Newtype tcon tbinds rep ) = - text "%newtype" <+> pname tcon <+> (hsep (map ptbind tbinds)) <+> repclause + text "%newtype" <+> pqname tcon <+> (hsep (map ptbind tbinds)) <+> repclause where repclause = case rep of Just ty -> char '=' <+> pty ty Nothing -> empty @@ -67,7 +60,7 @@ pcdef (Constr dcon tbinds tys) = pname id = text id pqname ("",id) = pname id -pqname (m,id) = pname m <> char '.' <> pname id +pqname (m,id) = pname m <> char '.' <> pname id ptbind (t,Klifted) = pname t ptbind (t,k) = parens (pname t <> text "::" <> pkind k) @@ -135,7 +128,7 @@ pexp (Case e vb alts) = sep [text "%case" <+> paexp e, $$ (indent (braces (vcat (punctuate (char ';') (map palt alts))))) pexp (Coerce t e) = (text "%coerce" <+> paty t) $$ pexp e pexp (Note s e) = (text "%note" <+> pstring s) $$ pexp e -pexp (Ccall n t) = (text "%ccall" <+> pstring n) $$ paty t +pexp (External n t) = (text "%external" <+> pstring n) $$ paty t pexp e = pfexp e