From b0283d31a2575fb8a7ae979b0109d97102992749 Mon Sep 17 00:00:00 2001 From: krasimir Date: Thu, 18 Jun 2009 17:44:29 +0000 Subject: [PATCH] in the ai command don't show the fun keyword if there aren't any functions. --- src/GF/Command/Commands.hs | 8 +++++--- 1 file 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"