From: christiaanb Date: Mon, 21 Jun 2010 12:55:22 +0000 (+0200) Subject: Print null character instead of empty character when adt has no fields X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=commitdiff_plain;h=34a7251cff433852cee6c26c7309bd4425740333 Print null character instead of empty character when adt has no fields --- diff --git a/clash/CLasH/VHDL/VHDLTools.hs b/clash/CLasH/VHDL/VHDLTools.hs index edaa5d2..8f282b4 100644 --- a/clash/CLasH/VHDL/VHDLTools.hs +++ b/clash/CLasH/VHDL/VHDLTools.hs @@ -649,7 +649,7 @@ mkAdtShow conLbl conIds elemIdss adtTM = AST.SubProgBody showSpec [] [showExpr] [AST.CaseSmAlt [AST.ChoiceE $ AST.PrimLit $ show x] [AST.ReturnSm (Just $ ((genExprFCall showId) . (selectedName adtPar) $ mkVHDLBasicId conLbl) AST.:&: showFields x)] | x <- [0..(length conIds) -1]] showFields i = if (null (elemIdss!!i)) then - AST.PrimLit "''" + AST.PrimLit "nul" else foldr1 (\e1 e2 -> e1 AST.:&: e2) $ map ((AST.PrimLit "' '" AST.:&:) . (genExprFCall showId) . (selectedName adtPar))