mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 03:09:33 -06:00
fix in PGF.Printer
This commit is contained in:
@@ -87,11 +87,13 @@ pType = do
|
|||||||
|
|
||||||
ppType :: Int -> [CId] -> Type -> PP.Doc
|
ppType :: Int -> [CId] -> Type -> PP.Doc
|
||||||
ppType d scope (DTyp hyps cat args)
|
ppType d scope (DTyp hyps cat args)
|
||||||
| null hyps = ppParens (d > 3) (ppRes scope cat args)
|
| null hyps = ppRes scope cat args
|
||||||
| otherwise = let (scope',hdocs) = mapAccumL (ppHypo 1) scope hyps
|
| otherwise = let (scope',hdocs) = mapAccumL (ppHypo 1) scope hyps
|
||||||
in ppParens (d > 0) (foldr (\hdoc doc -> hdoc PP.<+> PP.text "->" PP.<+> doc) (ppRes scope' cat args) hdocs)
|
in ppParens (d > 0) (foldr (\hdoc doc -> hdoc PP.<+> PP.text "->" PP.<+> doc) (ppRes scope' cat args) hdocs)
|
||||||
where
|
where
|
||||||
ppRes scope cat es = ppCId cat PP.<+> PP.hsep (map (ppExpr 4 scope) es)
|
ppRes scope cat es
|
||||||
|
| null es = ppCId cat
|
||||||
|
| otherwise = ppParens (d > 3) (ppCId cat PP.<+> PP.hsep (map (ppExpr 4 scope) es))
|
||||||
|
|
||||||
ppHypo :: Int -> [CId] -> (BindType,CId,Type) -> ([CId],PP.Doc)
|
ppHypo :: Int -> [CId] -> (BindType,CId,Type) -> ([CId],PP.Doc)
|
||||||
ppHypo d scope (Explicit,x,typ) = if x == wildCId
|
ppHypo d scope (Explicit,x,typ) = if x == wildCId
|
||||||
|
|||||||
Reference in New Issue
Block a user