From: Matthijs Kooijman Date: Wed, 11 Feb 2009 16:28:05 +0000 (+0100) Subject: Add Pretty instance for VHDLSession. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=ebaa33b2c4374947780a5ab6a232ae763a7484be;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add Pretty instance for VHDLSession. --- diff --git a/Pretty.hs b/Pretty.hs index bb62591..96f7f6e 100644 --- a/Pretty.hs +++ b/Pretty.hs @@ -2,6 +2,7 @@ module Pretty (prettyShow) where import Text.PrettyPrint.HughesPJClass import Flatten +import TranslatorTypes instance Pretty HsFunction where pPrint (HsFunction name args res) = @@ -38,3 +39,11 @@ instance Pretty SignalUse where instance Pretty CondDef where pPrint _ = text "TODO" + +instance Pretty VHDLSession where + pPrint (VHDLSession nameCount funcs) = + text "NameCount: " $$ nest 15 (int nameCount) + $+$ text "Functions: " $$ nest 15 (vcat (map ppfunc funcs)) + where + ppfunc (hsfunc, (flatfunc)) = + pPrint hsfunc $+$ (text "Flattened: " $$ nest 15 (pPrint flatfunc))