From 3b7e39fa4ab2dcfc6ec9591be6476b4240baf671 Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 29 Jan 2010 21:10:14 +0000 Subject: bugfix in the PGF typechecker and more test cases --- src/runtime/haskell/PGF/Printer.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/runtime/haskell/PGF/Printer.hs') diff --git a/src/runtime/haskell/PGF/Printer.hs b/src/runtime/haskell/PGF/Printer.hs index ee0fd4070..d458eb1a7 100644 --- a/src/runtime/haskell/PGF/Printer.hs +++ b/src/runtime/haskell/PGF/Printer.hs @@ -27,12 +27,13 @@ ppAbs name a = text "abstract" <+> ppCId name <+> char '{' $$ ppCat :: CId -> [Hypo] -> Doc ppCat c hyps = text "cat" <+> ppCId c <+> hsep (snd (mapAccumL ppHypo [] hyps)) -ppFun :: CId -> (Type,Int,[Equation]) -> Doc -ppFun f (t,_,eqs) = text "fun" <+> ppCId f <+> colon <+> ppType 0 [] t $$ - if null eqs - then empty - else text "def" <+> vcat [let (scope,ds) = mapAccumL (ppPatt 9) [] patts - in ppCId f <+> hsep ds <+> char '=' <+> ppExpr 0 scope res | Equ patts res <- eqs] +ppFun :: CId -> (Type,Int,Maybe [Equation]) -> Doc +ppFun f (t,_,Just eqs) = text "fun" <+> ppCId f <+> colon <+> ppType 0 [] t $$ + if null eqs + then empty + else text "def" <+> vcat [let (scope,ds) = mapAccumL (ppPatt 9) [] patts + in ppCId f <+> hsep ds <+> char '=' <+> ppExpr 0 scope res | Equ patts res <- eqs] +ppFun f (t,_,Nothing) = text "data" <+> ppCId f <+> colon <+> ppType 0 [] t ppCnc :: Language -> Concr -> Doc ppCnc name cnc = -- cgit v1.2.3