mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 11:19:32 -06:00
bug fixes in dependency handling
This commit is contained in:
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/08 18:08:58 $
|
-- > CVS $Date: 2005/03/15 17:18:51 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.10 $
|
-- > CVS $Revision: 1.11 $
|
||||||
--
|
--
|
||||||
-- Rebuild a source module from incomplete and its with-instance.
|
-- Rebuild a source module from incomplete and its with-instance.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -71,6 +71,7 @@ rebuildModule ms mo@(i,mi) = do
|
|||||||
let ops1 = ops ++ [o | o <- ops0, notElem (openedModule o) infs]
|
let ops1 = ops ++ [o | o <- ops0, notElem (openedModule o) infs]
|
||||||
++ [oQualif i i | i <- map snd insts] ----
|
++ [oQualif i i | i <- map snd insts] ----
|
||||||
++ [oSimple i | i <- map snd insts] ----
|
++ [oSimple i | i <- map snd insts] ----
|
||||||
|
---- ++ [oSimple ext] ---- to encode dependence
|
||||||
--- check if me is incomplete
|
--- check if me is incomplete
|
||||||
return $ ModMod $ Module mt0 stat' fs me ops1 js
|
return $ ModMod $ Module mt0 stat' fs me ops1 js
|
||||||
---- (mapTree (qualifInstanceInfo insts) js) -- not needed
|
---- (mapTree (qualifInstanceInfo insts) js) -- not needed
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/03/08 18:08:58 $
|
-- > CVS $Date: 2005/03/15 17:18:52 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.20 $
|
-- > CVS $Revision: 1.21 $
|
||||||
--
|
--
|
||||||
-- Decide what files to read as function of dependencies and time stamps.
|
-- Decide what files to read as function of dependencies and time stamps.
|
||||||
--
|
--
|
||||||
@@ -135,19 +135,27 @@ needCompile opts headers sfiles0 = paths $ res $ mark $ iter changed where
|
|||||||
(f,(path,st0)) <- sfiles,
|
(f,(path,st0)) <- sfiles,
|
||||||
let st = if (elem f cs) then CSComp else st0]
|
let st = if (elem f cs) then CSComp else st0]
|
||||||
|
|
||||||
|
|
||||||
-- if a compilable file depends on a resource, read gfr instead of gfc/env
|
-- if a compilable file depends on a resource, read gfr instead of gfc/env
|
||||||
-- but don't read gfr if already in env (by CSEnvR)
|
-- but don't read gfr if already in env (by CSEnvR)
|
||||||
-- Also read res if the option "retain" is present
|
-- Also read res if the option "retain" is present
|
||||||
|
-- Also, if a "with" file has to be compiled, read its mother file from source
|
||||||
|
|
||||||
res cs = map mkRes cs where
|
res cs = map mkRes cs where
|
||||||
mkRes x@(f,(path,st)) | elem st [CSRead,CSEnv] = case typ f of
|
mkRes x@(f,(path,st)) | elem st [CSRead,CSEnv] = case typ f of
|
||||||
t | elem t [MTyResource,MTyIncResource] &&
|
t | (not (null [m | (m,(_,CSComp)) <- cs,
|
||||||
(not (null [m | (m,(_,CSComp)) <- cs,
|
|
||||||
Just ms <- [lookup m allDeps], elem f ms])
|
Just ms <- [lookup m allDeps], elem f ms])
|
||||||
|| oElem retainOpers opts)
|
|| oElem retainOpers opts)
|
||||||
-> (f,(path,CSRes))
|
-> if elem t [MTyResource,MTyIncResource]
|
||||||
|
then (f,(path,CSRes)) else
|
||||||
|
if t == MTyIncomplete
|
||||||
|
then (f,(path,CSComp)) else
|
||||||
|
x
|
||||||
_ -> x
|
_ -> x
|
||||||
mkRes x = x
|
mkRes x = x
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- construct list of paths to read
|
-- construct list of paths to read
|
||||||
paths cs = [mkName f p st | (f,(p,st)) <- cs, elem st [CSComp, CSRead,CSRes]]
|
paths cs = [mkName f p st | (f,(p,st)) <- cs, elem st [CSComp, CSRead,CSRes]]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user