summaryrefslogtreecommitdiff
path: root/src/compiler/GFServer.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-02-24 17:12:38 +0000
committerhallgren <hallgren@chalmers.se>2012-02-24 17:12:38 +0000
commit03f3baeba3e4921446846828a2974e81e766f934 (patch)
treebe14419a0a3d2e27f6a2f707ed57d603f065397e /src/compiler/GFServer.hs
parent92aa961205b84d89184a954b1050d4bc31f2f568 (diff)
gfse: text mode editing: accept grammars with printname judgements
But printname judgements are ignored for now. Also fixed an UTF-8 encoding bug when parsing uploaded grammars in gf -server mode.
Diffstat (limited to 'src/compiler/GFServer.hs')
-rw-r--r--src/compiler/GFServer.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/GFServer.hs b/src/compiler/GFServer.hs
index cb66137b2..65ed6a315 100644
--- a/src/compiler/GFServer.hs
+++ b/src/compiler/GFServer.hs
@@ -27,7 +27,7 @@ import Text.JSON(encode,showJSON,makeObj)
import System.IO.Silently(hCapture)
import System.Process(readProcessWithExitCode)
import System.Exit(ExitCode(..))
-import Codec.Binary.UTF8.String(encodeString)
+import Codec.Binary.UTF8.String(decodeString,encodeString)
import GF.Infra.UseIO(readBinaryFile,writeBinaryFile)
import qualified PGFService as PS
import qualified ExampleService as ES
@@ -158,7 +158,8 @@ handle state0 cache execute1
let state' = maybe state (flip (M.insert dir) state) st'
return (state',ok200 output)
- parse qs = return (state,json200 (makeObj (map parseModule qs)))
+ parse qs =
+ return (state,json200 (makeObj(map(parseModule.apBoth decodeString) qs)))
cloud dir cmd qs =
case cmd of
@@ -382,6 +383,7 @@ removeDir dir =
toHeader "Content-Type" = FCGI.HttpContentType -- to avoid duplicate headers
toHeader s = FCGI.HttpExtensionHeader s -- cheating a bit
-}
+
-- * misc utils
@@ -392,5 +394,6 @@ inputs = queryToArguments . fixplus
decode c = [c]
mapFst f xys = [(f x,y)|(x,y)<-xys]
+apBoth f (x,y) = (f x,f y)
prop n v = (n,showJSON v)