1
0
forked from GitHub/gf-core

Fix build problem in PGFService.hs when configured without c-runtime

This commit is contained in:
hallgren
2014-04-08 20:45:54 +00:00
parent 2ca8024ba4
commit 5d4b849b14

View File

@@ -167,15 +167,6 @@ cpgfMain command (pgf,pc) =
let t = C.readExpr s
maybe (badRequest "bad tree" s) return t
lexer = maybe (return id) lexerfun =<< getInput "lexer"
where
lexerfun name =
case name of
"text" -> return (unwords . lexText)
"code" -> return (unwords . lexCode)
"mixed" -> return (unwords . lexMixed)
_ -> throwCGIError 400 "Unknown lexer" ["Unknown lexer: "++name]
{-
instance JSON C.CId where
readJSON x = readJSON x >>= maybe (fail "Bad language.") return . C.readCId
@@ -187,6 +178,15 @@ instance JSON C.Expr where
#endif
lexer = maybe (return id) lexerfun =<< getInput "lexer"
where
lexerfun name =
case name of
"text" -> return (unwords . lexText)
"code" -> return (unwords . lexCode)
"mixed" -> return (unwords . lexMixed)
_ -> throwCGIError 400 "Unknown lexer" ["Unknown lexer: "++name]
--------------------------------------------------------------------------------
-- * Haskell run-time functionality