mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -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
|
||||
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 $$
|
||||
if def == EEq []
|
||||
then empty
|
||||
else text "def" <+> text (prCId id) <+> char '=' <+> ppExpr 0 def))
|
||||
Just (ty,def) -> return $ fromString $
|
||||
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) $$
|
||||
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
|
||||
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])
|
||||
Nothing -> do putStrLn "unknown identifier"
|
||||
return void
|
||||
_ -> do putStrLn "a single identifier is expected from the command"
|
||||
return void
|
||||
})
|
||||
]
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user