summaryrefslogtreecommitdiff
path: root/src-3.0/GF/Compile/Extend.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-05-31 14:40:46 +0000
committeraarne <aarne@cs.chalmers.se>2008-05-31 14:40:46 +0000
commit9229c157642c3503d365f42fe5ecac414958ab9b (patch)
tree422dd9f790ddc0d970e6a03783486616d7c4eb14 /src-3.0/GF/Compile/Extend.hs
parent66c04672013a8d031ffe53012ed7e843bb54b750 (diff)
added positions to Module record; avoided Module constructor where possible; moved Refresh to Compile/
Diffstat (limited to 'src-3.0/GF/Compile/Extend.hs')
-rw-r--r--src-3.0/GF/Compile/Extend.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src-3.0/GF/Compile/Extend.hs b/src-3.0/GF/Compile/Extend.hs
index ae87b3e71..0dcde340a 100644
--- a/src-3.0/GF/Compile/Extend.hs
+++ b/src-3.0/GF/Compile/Extend.hs
@@ -40,22 +40,22 @@ extendModule ms (name,mod) = case mod of
mod' <- foldM extOne m (extend m)
return (name,ModMod mod')
where
- extOne mod@(Module mt st fs es ops js) (n,cond) = do
+ extOne mo (n,cond) = do
(m0,isCompl) <- do
m <- lookupModMod (MGrammar ms) n
-- test that the module types match, and find out if the old is complete
- testErr (sameMType (mtype m) mt)
+ testErr (sameMType (mtype m) (mtype mo))
("illegal extension type to module" +++ prt name)
return (m, isCompleteModule m)
----- return (m, if (isCompleteModule m) then True else not (isCompleteModule mod))
-- build extension in a way depending on whether the old module is complete
- js1 <- extendMod isCompl (n, isInherited cond) name (jments m0) js
+ js1 <- extendMod isCompl (n, isInherited cond) name (jments m0) (jments mo)
-- if incomplete, throw away extension information
- let me' = if isCompl then es else (filter ((/=n) . fst) es)
- return $ Module mt st fs me' ops js1
+ let es = extend mo
+ let es' = if isCompl then es else (filter ((/=n) . fst) es)
+ return $ mo {extend = es', jments = js1}
-- | When extending a complete module: new information is inserted,
-- and the process is interrupted if unification fails.