X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FUtils%2FPretty.hs;h=df78ad9ca9fea259af4ad00f857d210c6391abd3;hb=fc16bdb6576ef2c08d3675fdbf74fd61d5d25589;hp=4366b10f4c59ab696e2f9a39706daa83c45f727c;hpb=b2967df7f237e5b4db15d069895ca01c31712d9e;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git "a/c\316\273ash/CLasH/Utils/Pretty.hs" "b/c\316\273ash/CLasH/Utils/Pretty.hs" index 4366b10..df78ad9 100644 --- "a/c\316\273ash/CLasH/Utils/Pretty.hs" +++ "b/c\316\273ash/CLasH/Utils/Pretty.hs" @@ -1,21 +1,19 @@ module CLasH.Utils.Pretty (prettyShow, pprString, pprStringDebug) where - +-- Standard imports import qualified Data.Map as Map -import qualified Data.Foldable as Foldable -import qualified List +import Text.PrettyPrint.HughesPJClass +-- GHC API import qualified CoreSyn -import qualified Module -import qualified HscTypes -import Text.PrettyPrint.HughesPJClass import Outputable ( showSDoc, showSDocDebug, ppr, Outputable, OutputableBndr) +-- VHDL Imports import qualified Language.VHDL.Ppr as Ppr import qualified Language.VHDL.AST as AST import qualified Language.VHDL.AST.Ppr -import CLasH.Translator.TranslatorTypes +-- Local imports import CLasH.VHDL.VHDLTypes import CLasH.Utils.Core.CoreShow @@ -24,14 +22,6 @@ import CLasH.Utils.Core.CoreShow printList :: (a -> Doc) -> [a] -> Doc printList f = brackets . fsep . punctuate comma . map f -instance Pretty TranslatorSession where - pPrint (TranslatorSession mod nameCount) = - text "Module: " $$ nest 15 (text modname) - $+$ text "NameCount: " $$ nest 15 (int nameCount) - where - ppfunc (hsfunc, flatfunc) = - pPrint hsfunc $+$ nest 5 (pPrint flatfunc) - modname = showSDoc $ Module.pprModule (HscTypes.cm_module mod) {- instance Pretty FuncData where pPrint (FuncData flatfunc entity arch) = @@ -48,10 +38,11 @@ instance Pretty FuncData where -} instance Pretty Entity where - pPrint (Entity id args res) = + pPrint (Entity id args res decl) = text "Entity: " $$ nest 10 (pPrint id) $+$ text "Args: " $$ nest 10 (pPrint args) $+$ text "Result: " $$ nest 10 (pPrint res) + $+$ text "Declaration not shown" instance (OutputableBndr b, Show b) => Pretty (CoreSyn.Bind b) where pPrint (CoreSyn.NonRec b expr) =