summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/PGFtoProlog.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-01-29 21:10:14 +0000
committerkrasimir <krasimir@chalmers.se>2010-01-29 21:10:14 +0000
commit3b7e39fa4ab2dcfc6ec9591be6476b4240baf671 (patch)
tree4a82a254abbf1e801c98964d6e25e20dd132f0f3 /src/compiler/GF/Compile/PGFtoProlog.hs
parente5de8ea9fe981a11ffd2672dd047d107e65b63a0 (diff)
bugfix in the PGF typechecker and more test cases
Diffstat (limited to 'src/compiler/GF/Compile/PGFtoProlog.hs')
-rw-r--r--src/compiler/GF/Compile/PGFtoProlog.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/GF/Compile/PGFtoProlog.hs b/src/compiler/GF/Compile/PGFtoProlog.hs
index c55bf0522..896e18934 100644
--- a/src/compiler/GF/Compile/PGFtoProlog.hs
+++ b/src/compiler/GF/Compile/PGFtoProlog.hs
@@ -69,16 +69,16 @@ plCat (cat, hypos) = plFact "cat" (plTypeWithHypos typ)
args = reverse [EFun x | (_,x) <- subst]
typ = DTyp hypos' cat args
-plFun :: (CId, (Type, Int, [Equation])) -> String
+plFun :: (CId, (Type, Int, Maybe [Equation])) -> String
plFun (fun, (typ,_,_)) = plFact "fun" (plp fun : plTypeWithHypos typ')
where typ' = snd $ alphaConvert emptyEnv typ
plTypeWithHypos :: Type -> [String]
plTypeWithHypos (DTyp hypos cat args) = [plTerm (plp cat) (map plp args), plList (map (\(_,x,ty) -> plOper ":" (plp x) (plp ty)) hypos)]
-plFundef :: (CId, (Type,Int,[Equation])) -> [String]
-plFundef (fun, (_,_,[])) = []
-plFundef (fun, (_,_,eqs)) = [plFact "def" [plp fun, plp fundef']]
+plFundef :: (CId, (Type,Int,Maybe [Equation])) -> [String]
+plFundef (fun, (_,_,Nothing )) = []
+plFundef (fun, (_,_,Just eqs)) = [plFact "def" [plp fun, plp fundef']]
where fundef' = snd $ alphaConvert emptyEnv eqs