summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2013-11-28 13:27:45 +0000
committerhallgren <hallgren@chalmers.se>2013-11-28 13:27:45 +0000
commit29b1607f9380d0f9d3c722250b7793fcf22adc79 (patch)
treecd484627edc1b4f63ee9243cbd1a51dde8aca180 /src
parent5475dd7613705b2e8c3483f66796937cd0542e52 (diff)
SimpleEditor.Convert: adapt to recent character encoding changes
Things got simpler!
Diffstat (limited to 'src')
-rw-r--r--src/compiler/SimpleEditor/Convert.hs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/compiler/SimpleEditor/Convert.hs b/src/compiler/SimpleEditor/Convert.hs
index 86580834a..686bdba3b 100644
--- a/src/compiler/SimpleEditor/Convert.hs
+++ b/src/compiler/SimpleEditor/Convert.hs
@@ -8,16 +8,10 @@ import qualified Data.Map as Map
import Text.JSON(makeObj) --encode
import Text.PrettyPrint(render,text,(<+>))
--- 4 extra imports just to deal with the ByteString mess...
-import qualified Data.ByteString.Char8 as BS(pack)
-import Codec.Binary.UTF8.String(encodeString)
-import GF.Compile.Coding(decodeStringsInModule)
-import System.IO(utf8)
+import qualified Data.ByteString.UTF8 as UTF8(fromString)
---import GF.Compile.GetGrammar (getSourceModule)
import GF.Infra.Option(optionsGFO)
import GF.Infra.Ident(showIdent)
---import GF.Infra.UseIO(appIOE)
import GF.Grammar.Grammar
import GF.Grammar.Printer(ppParams,ppTerm,getAbs,TermPrintQual(..))
import GF.Grammar.Parser(runP,pModDef)
@@ -31,10 +25,10 @@ import SimpleEditor.JSON
parseModule (path,source) =
(path.=) $
- case runP pModDef (BS.pack (encodeString source)) of
+ case runP pModDef (UTF8.fromString source) of
Left (Pn l c,msg) ->
makeObj ["error".=msg, "location".= show l++":"++show c]
- Right mod -> case convModule (decodeStringsInModule utf8 mod) of
+ Right mod -> case convModule mod of
Ok g -> makeObj ["converted".=g]
Bad msg -> makeObj ["parsed".=msg]