From ebaa33b2c4374947780a5ab6a232ae763a7484be Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 11 Feb 2009 17:28:05 +0100 Subject: [PATCH] Add Pretty instance for VHDLSession. --- Pretty.hs | 9 +++++++++ 1 file changed, 9 insertions(+) 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)) -- 2.30.2