mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
GFC.hs: encodeFile_ is not available in the standard Data.Binary
This commit is contained in:
@@ -18,7 +18,8 @@ import GF.Data.ErrM
|
|||||||
import GF.System.Directory
|
import GF.System.Directory
|
||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Data.Binary
|
import Data.Binary(encode,encodeFile)
|
||||||
|
import Data.Binary.Put(runPut)
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
import qualified Data.ByteString as BSS
|
import qualified Data.ByteString as BSS
|
||||||
import qualified Data.ByteString.Lazy as BSL
|
import qualified Data.ByteString.Lazy as BSL
|
||||||
@@ -130,7 +131,8 @@ writePGF :: Options -> PGF -> IOE ()
|
|||||||
writePGF opts pgf
|
writePGF opts pgf
|
||||||
| flag optSplitPGF opts = do let outfile = grammarName opts pgf <.> "pgf"
|
| flag optSplitPGF opts = do let outfile = grammarName opts pgf <.> "pgf"
|
||||||
putPointE Normal opts ("Writing " ++ outfile ++ "...") $ liftIO $ do
|
putPointE Normal opts ("Writing " ++ outfile ++ "...") $ liftIO $ do
|
||||||
encodeFile_ outfile (putSplitAbs pgf)
|
--encodeFile_ outfile (putSplitAbs pgf)
|
||||||
|
BSL.writeFile outfile (runPut (putSplitAbs pgf))
|
||||||
forM_ (Map.toList (concretes pgf)) $ \cnc -> do
|
forM_ (Map.toList (concretes pgf)) $ \cnc -> do
|
||||||
let outfile = showCId (fst cnc) <.> "pgf_c"
|
let outfile = showCId (fst cnc) <.> "pgf_c"
|
||||||
putPointE Normal opts ("Writing " ++ outfile ++ "...") $ liftIO $ encodeFile outfile cnc
|
putPointE Normal opts ("Writing " ++ outfile ++ "...") $ liftIO $ encodeFile outfile cnc
|
||||||
|
|||||||
Reference in New Issue
Block a user