summaryrefslogtreecommitdiff
path: root/src/GF/Infra
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-10-16 17:38:57 +0000
committeraarne <aarne@cs.chalmers.se>2007-10-16 17:38:57 +0000
commitcec3d7d603a9e810c3b7f1287f7328ec39cff98d (patch)
tree5bbe992775ad6bd4ad78a6e2fc6c9c99c462ff77 /src/GF/Infra
parent869da61a5b965f4a6db9d54706ce333a902298d4 (diff)
found and temporarily solved the bug in LangGer gfcc generation
Diffstat (limited to 'src/GF/Infra')
-rw-r--r--src/GF/Infra/Modules.hs14
1 files changed, 11 insertions, 3 deletions
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