bug fix in the module dependencies checker

This commit is contained in:
krasimir
2009-01-31 10:49:01 +00:00
parent f207a4038e
commit 99c430e5f5
9 changed files with 73 additions and 58 deletions

View File

@@ -31,9 +31,9 @@ instance (Ord i, Binary i, Binary a) => Binary (MGrammar i a) where
get = fmap MGrammar get
instance (Ord i, Binary i, Binary a) => Binary (ModInfo i a) where
put mi = do put (mtype mi,mstatus mi,flags mi,extend mi,mwith mi,opens mi,jments mi,positions mi)
get = do (mtype,mstatus,flags,extend,mwith,opens,jments,positions) <- get
return (ModInfo mtype mstatus flags extend mwith opens jments positions)
put mi = do put (mtype mi,mstatus mi,flags mi,extend mi,mwith mi,opens mi,mexdeps mi,jments mi,positions mi)
get = do (mtype,mstatus,flags,extend,mwith,opens,med,jments,positions) <- get
return (ModInfo mtype mstatus flags extend mwith opens med jments positions)
instance (Binary i) => Binary (ModuleType i) where
put MTAbstract = putWord8 0
@@ -264,5 +264,5 @@ instance Binary MetaSymb where
decodeModHeader :: FilePath -> IO SourceModule
decodeModHeader fpath = do
(m,mtype,mstatus,flags,extend,mwith,opens) <- decodeFile fpath
return (m,ModInfo mtype mstatus flags extend mwith opens Map.empty Map.empty)
(m,mtype,mstatus,flags,extend,mwith,opens,med) <- decodeFile fpath
return (m,ModInfo mtype mstatus flags extend mwith opens med Map.empty Map.empty)

View File

@@ -25,7 +25,7 @@ import Data.Maybe (maybe)
import Data.List (intersperse)
ppModule :: SourceModule -> Doc
ppModule (mn, ModInfo mtype mstat opts exts with opens jments _) =
ppModule (mn, ModInfo mtype mstat opts exts with opens _ jments _) =
(let defs = tree2list jments
in if null defs
then hdr
@@ -58,7 +58,7 @@ ppModule (mn, ModInfo mtype mstat opts exts with opens jments _) =
ppExtends (id,MIOnly incs) = ppIdent id <+> brackets (commaPunct ppIdent incs)
ppExtends (id,MIExcept incs) = ppIdent id <+> char '-' <+> brackets (commaPunct ppIdent incs)
ppWith (id,ext,opens) = ppExtends (id,ext) <+> text "with" <+> commaPunct ppOpenSpec opens
ppWith (id,ext,opens) = ppExtends (id,ext) <+> text "with" <+> commaPunct ppInstSpec opens
ppOptions opts =
text "flags" $$
@@ -210,6 +210,8 @@ ppLabel = ppIdent . label2ident
ppOpenSpec (OSimple id) = ppIdent id
ppOpenSpec (OQualif id n) = parens (ppIdent id <+> equals <+> ppIdent n)
ppInstSpec (id,n) = parens (ppIdent id <+> equals <+> ppIdent n)
ppLocDef (id, (mbt, e)) =
ppIdent id <+>
(case mbt of {Just t -> colon <+> ppTerm 0 t; Nothing -> empty} <+> equals <+> ppTerm 0 e) <+> semi