summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-11-06 13:05:51 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-11-06 13:05:51 +0000
commita710e90c0bf0e92c8953d9b2afc6612087836028 (patch)
tree69e7e0422b17c05121499c9131f927755436ceb6
parentb8fd12e5e4aa58f1cea601fd2891f9a900cd9d43 (diff)
fix the deserialization of flags from the GFO files
-rw-r--r--src/compiler/GF/Grammar/Binary.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/GF/Grammar/Binary.hs b/src/compiler/GF/Grammar/Binary.hs
index 0e897aa00..6cd3832c0 100644
--- a/src/compiler/GF/Grammar/Binary.hs
+++ b/src/compiler/GF/Grammar/Binary.hs
@@ -17,7 +17,6 @@ import Data.Binary
--import Control.Monad
import qualified Data.Map as Map
import qualified Data.ByteString.Char8 as BS
-import Text.PrettyPrint (render)
import GF.Data.Operations
import GF.Infra.Ident
@@ -25,7 +24,7 @@ import GF.Infra.Option
import GF.Grammar.Grammar
import PGF() -- Binary instances
-import PGF.Data(ppLit)
+import PGF.Data(Literal(..))
-- Please change this every time when the GFO format is changed
gfoVersion = "GF03"
@@ -93,9 +92,13 @@ instance Binary ModuleStatus where
instance Binary Options where
put = put . optionsGFO
get = do opts <- get
- case parseModuleOptions ["--" ++ flag ++ "=" ++ render (ppLit value) | (flag,value) <- opts] of
+ case parseModuleOptions ["--" ++ flag ++ "=" ++ toString value | (flag,value) <- opts] of
Ok x -> return x
Bad msg -> fail msg
+ where
+ toString (LStr s) = s
+ toString (LInt n) = show n
+ toString (LFlt d) = show d
instance Binary Production where
put (Production res funid args) = put (res,funid,args)