From d64419f2f25f0fb5a28bddf198dce6ac26b75296 Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 2 Oct 2009 22:52:14 +0000 Subject: refactor GF.Infra.CheckM and use the CheckM monad in the renamer as well --- src/GF/Compile.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/GF/Compile.hs') diff --git a/src/GF/Compile.hs b/src/GF/Compile.hs index e3bdee456..0b928d430 100644 --- a/src/GF/Compile.hs +++ b/src/GF/Compile.hs @@ -24,6 +24,7 @@ import GF.Infra.Ident import GF.Infra.Option import GF.Infra.Modules import GF.Infra.UseIO +import GF.Infra.CheckM import GF.Data.Operations @@ -205,10 +206,11 @@ compileSourceModule opts env@(k,gr,_) mo@(i,mi) = do _ -> do let mos = modules gr - mo2:_ <- putpp " renaming " $ ioeErr $ renameModule mos mo1b + (mo2,warnings) <- putpp " renaming " $ ioeErr $ runCheck (renameModule mos mo1b) + if null warnings then return () else puts warnings $ return () intermOut opts DumpRename (ppModule Qualified mo2) - (mo3:_,warnings) <- putpp " type checking" $ ioeErr $ showCheckModule mos mo2 + (mo3,warnings) <- putpp " type checking" $ ioeErr $ runCheck (checkModule mos mo2) if null warnings then return () else puts warnings $ return () intermOut opts DumpTypeCheck (ppModule Qualified mo3) -- cgit v1.2.3