summaryrefslogtreecommitdiff
path: root/src/GF/Compile/ModDeps.hs
diff options
context:
space:
mode:
authorpeb <unknown>2005-02-09 19:45:54 +0000
committerpeb <unknown>2005-02-09 19:45:54 +0000
commit9afbd25b64607e68fe6275fb6b743159001ca984 (patch)
treec1c7f0f1bd7f83d721f4e55318160edd1f0eee1b /src/GF/Compile/ModDeps.hs
parentc467ef8d0323d896778c6ed68ce0b23441f3a65a (diff)
"Committed_by_peb"
Diffstat (limited to 'src/GF/Compile/ModDeps.hs')
-rw-r--r--src/GF/Compile/ModDeps.hs18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/GF/Compile/ModDeps.hs b/src/GF/Compile/ModDeps.hs
index 7e65239e4..797b445e0 100644
--- a/src/GF/Compile/ModDeps.hs
+++ b/src/GF/Compile/ModDeps.hs
@@ -10,6 +10,8 @@
-- > CVS $Revision $
--
-- Check correctness of module dependencies. Incomplete.
+--
+-- AR 13/5/2003
-----------------------------------------------------------------------------
module ModDeps where
@@ -27,12 +29,9 @@ import Operations
import Monad
import List
--- AR 13/5/2003
-
--- to check uniqueness of module names and import names, the
+-- | to check uniqueness of module names and import names, the
-- appropriateness of import and extend types,
-- to build a dependency graph of modules, and to sort them topologically
-
mkSourceGrammar :: [(Ident,SourceModInfo)] -> Err SourceGrammar
mkSourceGrammar ms = do
let ns = map fst ms
@@ -50,8 +49,7 @@ checkUniqueErr ms = do
let msg = checkUnique ms
if null msg then return () else Bad $ unlines msg
--- check that import names don't clash with module names
-
+-- | check that import names don't clash with module names
checkUniqueImportNames :: [Ident] -> SourceModInfo -> Err ()
checkUniqueImportNames ns mo = case mo of
ModMod m -> test [n | OQualif _ n v <- opens m, n /= v]
@@ -62,11 +60,10 @@ checkUniqueImportNames ns mo = case mo of
("import names clashing with module names among" +++
unwords (map prt ms))
--- to decide what modules immediately depend on what, and check if the
--- dependencies are appropriate
-
type Dependencies = [(IdentM Ident,[IdentM Ident])]
+-- | to decide what modules immediately depend on what, and check if the
+-- dependencies are appropriate
moduleDeps :: [(Ident,SourceModInfo)] -> Err Dependencies
moduleDeps ms = mapM deps ms where
deps (c,mi) = errIn ("checking dependencies of module" +++ prt c) $ case mi of
@@ -119,9 +116,8 @@ openInterfaces ds m = do
let mods = iterFix (concatMap more) (more (m,undefined))
return $ [i | (i,MTInterface) <- mods]
--- this function finds out what modules are really needed in the canoncal gr.
+-- | this function finds out what modules are really needed in the canoncal gr.
-- its argument is typically a concrete module name
-
requiredCanModules :: (Eq i, Show i) => MGrammar i f a -> i -> [i]
requiredCanModules gr = nub . iterFix (concatMap more) . singleton where
more i = errVal [] $ do