Commit 0e7fba83 authored by AVANZINI Martin's avatar AVANZINI Martin
Browse files

cexp pretty printer slightly adapted

parent ce812aa1
......@@ -231,8 +231,8 @@ norms c = S.fromList [n | GNorm _ _ n <- gNorms c]
-- pretty printers
instance PP.Pretty Norm where
pretty (Norm _ e) = PP.text "<" PP.<> PP.pretty e PP.<> PP.text ">"
-- pretty (Norm g e) = PP.brackets (PP.hang 0 (PP.pretty e PP.</> PP.text "|" PP.<+> PP.pretty g))
pretty (Norm _ e) = PP.text "<" PP.<> PP.hang 0 (PP.pretty e) PP.<> PP.text ">"
-- pretty (Norm g e) = PP.brackets (PP.hang 0 (PP.group (PP.pretty e) PP.</> PP.text "|" PP.<+> PP.group (PP.pretty g)))
instance (PP.Pretty c, Eq c, Num c) => PP.Pretty (CExp c) where
pretty = pp id where
......@@ -244,7 +244,8 @@ instance (PP.Pretty c, Eq c, Num c) => PP.Pretty (CExp c) where
pp par (Plus c d) = par (infx (pp id c) "+" (pp id d))
pp _ (Sup c d) = ppFun "sup" [ PP.pretty c, PP.pretty d ]
pp _ (Cond g c d)
| d == zero = PP.hang 1 (PP.brackets (PP.pretty g) PP.<> PP.text "·" PP.<> pp PP.parens c)
| d == zero = PP.hang 1 (PP.brackets (PP.align (PP.pretty g))
PP.</> PP.text "·" PP.<+> PP.group (pp PP.parens c))
| otherwise = PP.text "ite" PP.<> PP.tupled [ PP.pretty g, pp id c, pp id d ]
ppFun f ls = PP.text f PP.<> PP.tupled ls
infx l s r = PP.hang 1 (l PP.</> PP.text s PP.<+> r)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment