the default function of the PGFService should return list of functions as well as list of categories

This commit is contained in:
krasimir
2009-11-26 14:47:35 +00:00
parent b596086edf
commit 12d64654d7
7 changed files with 86 additions and 19 deletions

View File

@@ -138,7 +138,8 @@ doGrammar :: PGF -> Maybe (Accept Language) -> JSValue
doGrammar pgf macc = showJSON $ toJSObject
[("name", showJSON (PGF.abstractName pgf)),
("userLanguage", showJSON (selectLanguage pgf macc)),
("categories", showJSON categories),
("categories", showJSON categories),
("functions", showJSON functions),
("languages", showJSON languages)]
where languages = map toJSObject
[[("name", showJSON l),
@@ -146,6 +147,7 @@ doGrammar pgf macc = showJSON $ toJSObject
("canParse", showJSON $ PGF.canParse pgf l)]
| l <- PGF.languages pgf]
categories = map toJSObject [[("name", PGF.showCId cat)] | cat <- PGF.categories pgf]
functions = map toJSObject [[("name", PGF.showCId fun)] | fun <- PGF.functions pgf]
doGraphvizAbstrTree pgf tree = do
let dot = PGF.graphvizAbstractTree pgf (True,True) tree