summaryrefslogtreecommitdiff
path: root/src/GF/Command/Commands.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-05-13 06:27:31 +0000
committerkrasimir <krasimir@chalmers.se>2009-05-13 06:27:31 +0000
commitfdba7d20eee5a10f15a77f2140a8f6ffd31a9e67 (patch)
tree591b70ec7d93fa0f01ca3a644db5095b9ff9053b /src/GF/Command/Commands.hs
parentb037cbc361da5933e7c37f0117e46fbc07d2594f (diff)
now command 'ai' prints the list of functions for given category
Diffstat (limited to 'src/GF/Command/Commands.hs')
-rw-r--r--src/GF/Command/Commands.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs
index 8f82b468f..6891b45b0 100644
--- a/src/GF/Command/Commands.hs
+++ b/src/GF/Command/Commands.hs
@@ -600,14 +600,15 @@ allCommands cod env@(pgf, mos) = Map.fromList [
exec = \opts arg -> do
case arg of
[Fun id []] -> case Map.lookup id (funs (abstract pgf)) of
- Just (ty,def) -> putStrLn (render (text "fun" <+> text (prCId id) <+> colon <+> ppType 0 ty $$
+ Just (ty,def) -> putStrLn (render (text "fun" <+> text (prCId id) <+> colon <+> ppType 0 ty $$
if def == EEq []
then empty
else text "def" <+> text (prCId id) <+> char '=' <+> ppExpr 0 def))
Nothing -> case Map.lookup id (cats (abstract pgf)) of
- Just hyps -> putStrLn (render (text "cat" <+>
- text (prCId id) <+>
- hsep (map ppHypo hyps)))
+ Just hyps -> putStrLn (render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$
+ space $$
+ text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
+ | (fid,ty) <- functionsToCat pgf id]))
Nothing -> putStrLn "unknown identifier"
_ -> putStrLn "a single identifier is expected from the command"
return void