summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-11-26 14:43:31 +0000
committerkrasimir <krasimir@chalmers.se>2009-11-26 14:43:31 +0000
commitba1b602053300d982e973f446e44bd7a436c157d (patch)
tree558a2dcfd55ea676eaa2aa8cfe6b5286c3239089 /src/server
parent6b0a662c35856beb306f0c873869e4a0e02165ef (diff)
change PGF.categories to return list of identifiers instead of types
Diffstat (limited to 'src/server')
-rw-r--r--src/server/PGFService.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs
index c4290b7da..0a457395f 100644
--- a/src/server/PGFService.hs
+++ b/src/server/PGFService.hs
@@ -69,9 +69,8 @@ pgfMain pgf command =
Nothing -> return Nothing
Just "" -> return Nothing
Just cat -> case PGF.readType cat of
- Nothing -> throwCGIError 400 "Bad category" ["Bad category: " ++ cat]
- Just typ | typ `elem` PGF.categories pgf -> return $ Just typ
- | otherwise -> throwCGIError 400 "Unknown category" ["Unknown category: " ++ PGF.showType [] typ]
+ Nothing -> throwCGIError 400 "Bad category" ["Bad category: " ++ cat]
+ Just typ -> return $ Just typ -- typecheck the category
getFrom :: CGI (Maybe PGF.Language)
getFrom = getLang "from"
@@ -146,7 +145,7 @@ doGrammar pgf macc = showJSON $ toJSObject
("languageCode", showJSON $ fromMaybe "" (PGF.languageCode pgf l)),
("canParse", showJSON $ PGF.canParse pgf l)]
| l <- PGF.languages pgf]
- categories = map toJSObject [[("cat", PGF.showType [] cat)] | cat <- PGF.categories pgf]
+ categories = map toJSObject [[("name", PGF.showCId cat)] | cat <- PGF.categories pgf]
doGraphvizAbstrTree pgf tree = do
let dot = PGF.graphvizAbstractTree pgf (True,True) tree