projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8325780
)
Add Pretty instance for VHDLSession.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Wed, 11 Feb 2009 16:28:05 +0000
(17:28 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Wed, 11 Feb 2009 16:28:05 +0000
(17:28 +0100)
Pretty.hs
patch
|
blob
|
history
diff --git
a/Pretty.hs
b/Pretty.hs
index bb62591007c64b089a6476a26815d88c8248f1e6..96f7f6e8d6b3b2a73fb1169e758bcd56f5fbc926 100644
(file)
--- a/
Pretty.hs
+++ b/
Pretty.hs
@@
-2,6
+2,7
@@
module Pretty (prettyShow) where
import Text.PrettyPrint.HughesPJClass
import Flatten
import Text.PrettyPrint.HughesPJClass
import Flatten
+import TranslatorTypes
instance Pretty HsFunction where
pPrint (HsFunction name args res) =
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 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))