diff options
| author | aarne <unknown> | 2003-10-21 15:15:47 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2003-10-21 15:15:47 +0000 |
| commit | 31e0deb017a938bc91f49d8505104d97bc8af14f (patch) | |
| tree | 17bab7f3245786136f4f76b2c8e698d3a4336ec0 /src/GF/Compile/Rename.hs | |
| parent | d0c75667910bfe5e2ee3f8434d7079f2c1bed65c (diff) | |
Rebuilding resource libraries.
Rebuilding resource libraries.
Working with resource interfaces.
Diffstat (limited to 'src/GF/Compile/Rename.hs')
| -rw-r--r-- | src/GF/Compile/Rename.hs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/GF/Compile/Rename.hs b/src/GF/Compile/Rename.hs index a4d9b9365..6f652820a 100644 --- a/src/GF/Compile/Rename.hs +++ b/src/GF/Compile/Rename.hs @@ -62,7 +62,7 @@ extendModule ms (name,mod) = case mod of _ -> Bad $ "cannot find extended module" +++ prt n extendMod n (jments m0) js _ -> return js - return $ (name,ModMod (Module mt fs Nothing ops js1)) + return $ (name,ModMod (Module mt fs me ops js1)) type Status = (StatusTree, [(OpenSpec Ident, StatusTree)]) @@ -72,7 +72,9 @@ type StatusTree = BinTree (Ident,StatusInfo) type StatusInfo = Ident -> Term renameIdentTerm :: Status -> Term -> Err Term -renameIdentTerm env@(act,imps) t = case t of +renameIdentTerm env@(act,imps) t = + errIn ("atomic term" +++ prt t +++ "given" +++ unwords (map (prt . fst) qualifs)) $ + case t of Vr c -> do f <- lookupTreeMany prt opens c return $ f c @@ -90,7 +92,8 @@ renameIdentTerm env@(act,imps) t = case t of _ -> return t where opens = act : [st | (OSimple _,st) <- imps] - qualifs = [ (m, st) | (OQualif m _, st) <- imps] + qualifs = [(m, st) | (OQualif m _, st) <- imps] ++ + [(m, st) | (OSimple m, st) <- imps] -- qualifying is always possible --- would it make sense to optimize this by inlining? renameIdentPatt :: Status -> Patt -> Err Patt @@ -117,8 +120,9 @@ tree2status o = case o of buildStatus :: SourceGrammar -> Ident -> SourceModInfo -> Err Status buildStatus gr c mo = let mo' = self2status c mo in case mo of ModMod m -> do - let ops = allOpens m - mods <- mapM (lookupModule gr . openedModule) ops + let gr1 = MGrammar $ (c,mo) : modules gr + ops = [OSimple e | e <- allExtends gr1 c] ++ allOpens m + mods <- mapM (lookupModule gr1 . openedModule) ops let sts = map modInfo2status $ zip ops mods return $ if isModCnc m then (NT, sts) -- the module itself does not define any names |
