1
0
forked from GitHub/gf-core

Some refactoring in GF.Compile and GF.Compile.GetGrammar

Move source transcoding function GF.Compile to GF.Compile.GetGrammar, in
preparation for doing transcoding before lexing.
This commit is contained in:
hallgren
2013-11-21 16:27:26 +00:00
parent fe065b5ee4
commit 260c0dfedc
2 changed files with 22 additions and 19 deletions

View File

@@ -13,7 +13,6 @@ import GF.Compile.GrammarToPGF
import GF.Compile.ReadFiles
import GF.Compile.Update
--import GF.Compile.Refresh
import GF.Compile.Coding
import GF.Compile.Tags
import GF.Grammar.Grammar
@@ -27,7 +26,6 @@ import GF.Infra.CheckM
import GF.Data.Operations
import Control.Monad
import System.IO
import GF.System.Directory
import System.FilePath
import qualified Data.Map as Map
@@ -164,11 +162,8 @@ compileOne opts env@(_,srcgr,_) file = do
then compileOne opts env $ (gf2gfo opts file)
else do
sm00 <- putpOpt ("- parsing" +++ file) ("- compiling" +++ file ++ "... ") $
getSourceModule opts file
enc <- liftIO $ mkTextEncoding (renameEncoding (flag optEncoding (mflags (snd sm00))))
let sm = decodeStringsInModule enc sm00
sm <- putpOpt ("- parsing" +++ file) ("- compiling" +++ file ++ "... ")
$ getSourceModule opts file
intermOut opts (Dump Source) (ppModule Internal sm)
compileSourceModule opts env (Just file) sm