summaryrefslogtreecommitdiff
path: root/src/GF/Conversion/SimpleToFinite.hs
diff options
context:
space:
mode:
authorpeb <unknown>2005-09-01 08:53:18 +0000
committerpeb <unknown>2005-09-01 08:53:18 +0000
commit7ad0dda9ed46b9ea80972123eac49d8f068efa7a (patch)
treef68cb8d0c8305db5126c675c3136d7eceb4dfdc6 /src/GF/Conversion/SimpleToFinite.hs
parentf323d48fbbabee7213b5a61ba160f7fd438a684c (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Conversion/SimpleToFinite.hs')
-rw-r--r--src/GF/Conversion/SimpleToFinite.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/GF/Conversion/SimpleToFinite.hs b/src/GF/Conversion/SimpleToFinite.hs
index adc8afc78..b875a698e 100644
--- a/src/GF/Conversion/SimpleToFinite.hs
+++ b/src/GF/Conversion/SimpleToFinite.hs
@@ -4,9 +4,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
--- > CVS $Date: 2005/05/13 12:40:19 $
+-- > CVS $Date: 2005/09/01 09:53:19 $
-- > CVS $Author: peb $
--- > CVS $Revision: 1.6 $
+-- > CVS $Revision: 1.7 $
--
-- Calculating the finiteness of each type in a grammar
-----------------------------------------------------------------------------
@@ -56,13 +56,13 @@ expandTyping split fun env (Decl x cat args) [] decls
= return $ Abs decl (reverse decls) fun
where decl = substArgs split x env cat args []
expandTyping split fun env typ (Decl x xcat xargs : declsToDo) declsDone
- = do (xcat', env') <- calcNewEnv
- let decl = substArgs split x env xcat' xargs []
+ = do (x', xcat', env') <- calcNewEnv
+ let decl = substArgs split x' env xcat' xargs []
expandTyping split fun env' typ declsToDo (decl : declsDone)
where calcNewEnv = case splitableCat split xcat of
Just newCats -> do newCat <- member newCats
- return (newCat, (x,newCat) : env)
- Nothing -> return (xcat, env)
+ return (anyVar, newCat, (x,newCat) : env)
+ Nothing -> return (x, xcat, env)
substArgs :: Splitable -> Var -> [(Var, SCat)] -> SCat -> [TTerm] -> [TTerm] -> SDecl
substArgs split x env cat [] args = Decl x cat (reverse args)
@@ -96,7 +96,8 @@ calcSplitable rules = (listAssoc splitableCat2Funs, listAssoc splitableFun2Cat)
[ (fun, mergeFun fun cat) | (cat, fun) <- splitableCatFuns ]
-- cat-fun pairs that are splitable
- splitableCatFuns = [ (cat, name2fun name) |
+ splitableCatFuns = tracePrt "SimpleToFinite - splitable functions" prt $
+ [ (cat, name2fun name) |
Rule (Abs (Decl _ cat []) [] name) _ <- rules,
splitableCats ?= cat ]