mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
in the ai command don't show the fun keyword if there aren't any functions.
This commit is contained in:
@@ -610,9 +610,11 @@ allCommands cod env@(pgf, mos) = Map.fromList [
|
|||||||
Nothing -> case Map.lookup id (cats (abstract pgf)) of
|
Nothing -> case Map.lookup id (cats (abstract pgf)) of
|
||||||
Just hyps -> do return $ fromString $
|
Just hyps -> do return $ fromString $
|
||||||
render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$
|
render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$
|
||||||
space $$
|
if null (functionsToCat pgf id)
|
||||||
text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
|
then empty
|
||||||
| (fid,ty) <- functionsToCat pgf id])
|
else space $$
|
||||||
|
text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
|
||||||
|
| (fid,ty) <- functionsToCat pgf id])
|
||||||
Nothing -> do putStrLn "unknown identifier"
|
Nothing -> do putStrLn "unknown identifier"
|
||||||
return void
|
return void
|
||||||
_ -> do putStrLn "a single identifier is expected from the command"
|
_ -> do putStrLn "a single identifier is expected from the command"
|
||||||
|
|||||||
Reference in New Issue
Block a user