mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
in command 'ai' send the output through the pipe
This commit is contained in:
@@ -600,18 +600,21 @@ allCommands cod env@(pgf, mos) = Map.fromList [
|
|||||||
exec = \opts arg -> do
|
exec = \opts arg -> do
|
||||||
case arg of
|
case arg of
|
||||||
[Fun id []] -> case Map.lookup id (funs (abstract pgf)) 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) -> return $ fromString $
|
||||||
if def == EEq []
|
render (text "fun" <+> text (prCId id) <+> colon <+> ppType 0 ty $$
|
||||||
then empty
|
if def == EEq []
|
||||||
else text "def" <+> text (prCId id) <+> char '=' <+> ppExpr 0 def))
|
then empty
|
||||||
|
else text "def" <+> text (prCId id) <+> char '=' <+> ppExpr 0 def)
|
||||||
Nothing -> case Map.lookup id (cats (abstract pgf)) of
|
Nothing -> case Map.lookup id (cats (abstract pgf)) of
|
||||||
Just hyps -> putStrLn (render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$
|
Just hyps -> do return $ fromString $
|
||||||
space $$
|
render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$
|
||||||
text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
|
space $$
|
||||||
| (fid,ty) <- functionsToCat pgf id]))
|
text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
|
||||||
Nothing -> putStrLn "unknown identifier"
|
| (fid,ty) <- functionsToCat pgf id])
|
||||||
_ -> putStrLn "a single identifier is expected from the command"
|
Nothing -> do putStrLn "unknown identifier"
|
||||||
return void
|
return void
|
||||||
|
_ -> do putStrLn "a single identifier is expected from the command"
|
||||||
|
return void
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user