From a2626e24dd9e468ee0c5ccd455e4a5f782d56522 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Tue, 15 Nov 2011 19:12:22 +0000 Subject: now we store version number in every .gfo file. If the file is compiled with different compiler then we simply recompile it. --- src/compiler/GF/Compile.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/compiler/GF/Compile.hs') diff --git a/src/compiler/GF/Compile.hs b/src/compiler/GF/Compile.hs index 01679f727..a52167450 100644 --- a/src/compiler/GF/Compile.hs +++ b/src/compiler/GF/Compile.hs @@ -33,7 +33,6 @@ import qualified Data.Map as Map import qualified Data.Set as Set import Data.List(nub) import Data.Maybe (isNothing) -import Data.Binary import qualified Data.ByteString.Char8 as BS import Text.PrettyPrint @@ -144,7 +143,7 @@ compileOne opts env@(_,srcgr,_) file = do -- for compiled gf, read the file and update environment -- also undo common subexp optimization, to enable normal computations ".gfo" -> do - sm00 <- putPointE Verbose opts ("+ reading" +++ file) $ ioeIO (decodeFile file) + sm00 <- putPointE Verbose opts ("+ reading" +++ file) $ ioeIO (decodeModule file) let sm0 = (fst sm00, (snd sm00) {mflags = mflags (snd sm00) `addOptions` opts}) intermOut opts DumpSource (ppModule Internal sm0) @@ -243,7 +242,7 @@ writeGFO opts file mo = do let mo1 = subexpModule mo mo2 = case mo1 of (m,mi) -> (m,mi{jments=Map.filter (\x -> case x of {AnyInd _ _ -> False; _ -> True}) (jments mi)}) - putPointE Normal opts (" write file" +++ file) $ ioeIO $ encodeFile file mo2 + putPointE Normal opts (" write file" +++ file) $ ioeIO $ encodeModule file mo2 -- auxiliaries -- cgit v1.2.3