summaryrefslogtreecommitdiff
path: root/src/GF/Command/Commands.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-06-18 17:44:29 +0000
committerkrasimir <krasimir@chalmers.se>2009-06-18 17:44:29 +0000
commit13232a5e8125bfcb9a3c03ec0764b41500163c76 (patch)
tree6c141e48d04d4e4c578175c6aa23c8c5f5d7a392 /src/GF/Command/Commands.hs
parentd2dd0830f1743592cf2a78353abaf83af351e331 (diff)
in the ai command don't show the fun keyword if there aren't any functions.
Diffstat (limited to 'src/GF/Command/Commands.hs')
-rw-r--r--src/GF/Command/Commands.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs
index 2c30b89d0..7ea046cbb 100644
--- a/src/GF/Command/Commands.hs
+++ b/src/GF/Command/Commands.hs
@@ -610,9 +610,11 @@ allCommands cod env@(pgf, mos) = Map.fromList [
Nothing -> case Map.lookup id (cats (abstract pgf)) of
Just hyps -> do return $ fromString $
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])
+ if null (functionsToCat pgf id)
+ then empty
+ else space $$
+ text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
+ | (fid,ty) <- functionsToCat pgf id])
Nothing -> do putStrLn "unknown identifier"
return void
_ -> do putStrLn "a single identifier is expected from the command"