X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=Pretty.hs;h=6608f809088919db992ff7d5a57d62cb2ba623a4;hb=1e30fe04f4c285970ad2d5e23930dd935b4214fa;hp=6d495694f8a7fc4dab1fbe14b9378d550f67a8f7;hpb=d704c6a23e75f563d4816a0e01219fa7a3be266c;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/Pretty.hs b/Pretty.hs index 6d49569..6608f80 100644 --- a/Pretty.hs +++ b/Pretty.hs @@ -51,8 +51,17 @@ instance Pretty FlatFunction where instance Pretty SigDef where pPrint (FApp func args res) = pPrint func <> text " : " <> pPrint args <> text " -> " <> pPrint res - pPrint (CondDef _ _ _ _) = text "TODO" - pPrint (UncondDef src dst) = text "TODO" + pPrint (CondDef cond true false res) = + pPrint cond <> text " ? " <> pPrint true <> text " : " <> pPrint false <> text " -> " <> pPrint res + pPrint (UncondDef src dst) = + ppsrc src <> text " -> " <> pPrint dst + where + ppsrc (Left id) = pPrint id + ppsrc (Right expr) = pPrint expr + +instance Pretty SignalExpr where + pPrint (EqLit id lit) = + parens $ pPrint id <> text " = " <> text lit instance Pretty SignalInfo where pPrint (SignalInfo name use ty) =