From cec3d7d603a9e810c3b7f1287f7328ec39cff98d Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 16 Oct 2007 17:38:57 +0000 Subject: found and temporarily solved the bug in LangGer gfcc generation --- src/GF/Infra/Modules.hs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/GF/Infra/Modules.hs') diff --git a/src/GF/Infra/Modules.hs b/src/GF/Infra/Modules.hs index b0fe1b0ba..4d50608c6 100644 --- a/src/GF/Infra/Modules.hs +++ b/src/GF/Infra/Modules.hs @@ -28,7 +28,8 @@ module GF.Infra.Modules ( oSimple, oQualif, ModuleStatus(..), openedModule, allOpens, depPathModule, allDepsModule, partOfGrammar, - allExtends, allExtendsPlus, allExtensions, searchPathModule, addModule, + allExtends, allExtendSpecs, allExtendsPlus, allExtensions, + searchPathModule, addModule, emptyMGrammar, emptyModInfo, emptyModule, IdentM(..), typeOfModule, abstractOfConcrete, abstractModOfConcrete, @@ -216,8 +217,7 @@ partOfGrammar gr (i,m) = MGrammar [mo | mo@(j,_) <- mods, elem j modsFor] ---- ModWith n i os -> i : map openedModule os ++ partOfGrammar (ModMod n) ---- _ -> [i] - --- | all modules that a module extends, directly or indirectly +-- | all modules that a module extends, directly or indirectly, without restricts allExtends :: (Show i,Ord i) => MGrammar i f a -> i -> [i] allExtends gr i = case lookupModule gr i of Ok (ModMod m) -> case extends m of @@ -225,6 +225,14 @@ allExtends gr i = case lookupModule gr i of is -> i : concatMap (allExtends gr) is _ -> [] +-- | all modules that a module extends, directly or indirectly, with restricts +allExtendSpecs :: (Show i,Ord i) => MGrammar i f a -> i -> [(i,MInclude i)] +allExtendSpecs gr i = case lookupModule gr i of + Ok (ModMod m) -> case extend m of + [] -> [(i,MIAll)] + is -> (i,MIAll) : concatMap (allExtendSpecs gr . fst) is + _ -> [] + -- | this plus that an instance extends its interface allExtendsPlus :: (Show i,Ord i) => MGrammar i f a -> i -> [i] allExtendsPlus gr i = case lookupModule gr i of -- cgit v1.2.3