summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2013-11-28 13:55:08 +0000
committerhallgren <hallgren@chalmers.se>2013-11-28 13:55:08 +0000
commitead60581afa77510e43a65227b74b09023855cb5 (patch)
tree0a5077b4a1f96f712d65b52dfada6eb4e874cfb9 /src
parent29b1607f9380d0f9d3c722250b7793fcf22adc79 (diff)
GFI: adapt to character encoding changes
GF.Compile.Coding is not used any more.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GF/Compile/Coding.hs3
-rw-r--r--src/compiler/GFI.hs17
2 files changed, 11 insertions, 9 deletions
diff --git a/src/compiler/GF/Compile/Coding.hs b/src/compiler/GF/Compile/Coding.hs
index d635ff2e4..65d385022 100644
--- a/src/compiler/GF/Compile/Coding.hs
+++ b/src/compiler/GF/Compile/Coding.hs
@@ -1,5 +1,5 @@
module GF.Compile.Coding where
-
+{-
import GF.Grammar.Grammar
import GF.Grammar.Macros
import GF.Text.Coding
@@ -61,3 +61,4 @@ codeStringLiterals co ('"':cs) = '"' : inStringLiteral cs
inStringLiteral ('\\':d:ds) = '\\' : co [d] ++ inStringLiteral ds
inStringLiteral (d:ds) = co [d] ++ inStringLiteral ds
codeStringLiterals co (c:cs) = c : codeStringLiterals co cs
+-} \ No newline at end of file
diff --git a/src/compiler/GFI.hs b/src/compiler/GFI.hs
index 094b0c787..8fdc97ecc 100644
--- a/src/compiler/GFI.hs
+++ b/src/compiler/GFI.hs
@@ -24,9 +24,9 @@ import GF.Infra.UseIO(ioErrorText)
import GF.Infra.SIO
import GF.Infra.Option
import qualified System.Console.Haskeline as Haskeline
-import GF.Text.Coding(decodeUnicode,encodeUnicode)
+--import GF.Text.Coding(decodeUnicode,encodeUnicode)
-import GF.Compile.Coding(codeTerm)
+--import GF.Compile.Coding(codeTerm)
import PGF
import PGF.Data
@@ -35,9 +35,10 @@ import PGF.Macros
import Data.Char
import Data.List(nub,isPrefixOf,isInfixOf,partition)
import qualified Data.Map as Map
-import qualified Data.ByteString.Char8 as BS
+--import qualified Data.ByteString.Char8 as BS
+import qualified Data.ByteString.UTF8 as UTF8(fromString)
import qualified Text.ParserCombinators.ReadP as RP
-import System.IO(utf8)
+--import System.IO(utf8)
--import System.CPUTime(getCPUTime)
import System.Directory({-getCurrentDirectory,-}getAppUserDataDirectory)
import Control.Exception(SomeException,fromException,evaluate,try)
@@ -183,18 +184,18 @@ execute1 opts gfenv0 s0 =
"-old":ws' -> (False,ws')
_ -> (flag optNewComp opts,ws)
- case runP pExp (encodeUnicode utf8 s) of
+ case runP pExp (UTF8.fromString s) of
Left (_,msg) -> putStrLn msg
Right t -> putStrLn . err id (showTerm sgr style q)
. checkComputeTerm' new sgr
- $ codeTerm (decodeUnicode utf8 . BS.pack) t
+ $ {-codeTerm (decodeUnicode utf8 . BS.pack)-} t
continue gfenv
show_deps ws = do
let (os,xs) = partition (isPrefixOf "-") ws
ops <- case xs of
_:_ -> do
- let ts = [t | Right t <- map (runP pExp . encodeUnicode utf8) xs]
+ let ts = [t | Right t <- map (runP pExp . UTF8.fromString) xs]
err error (return . nub . concat) $ mapM (constantDepsTerm sgr) ts
_ -> error "expected one or more qualified constants as argument"
let prTerm = showTerm sgr TermPrintDefault Qualified
@@ -217,7 +218,7 @@ execute1 opts gfenv0 s0 =
let isRaw = elem "-raw" os
ops <- case ts of
_:_ -> do
- let Right t = runP pExp (encodeUnicode utf8 (unwords ts))
+ let Right t = runP pExp (UTF8.fromString (unwords ts))
ty <- err error return $ checkComputeTerm sgr t
return $ allOpersTo sgr ty
_ -> return $ allOpers sgr