mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-09-19 16:56:02 -06:00
fix pretty printing for dependent categories
This commit is contained in:
@@ -307,13 +307,9 @@ str s = doubleQuotes (pp (foldr showLitChar "" s))
|
|||||||
| c > '\DEL' = showChar c
|
| c > '\DEL' = showChar c
|
||||||
| otherwise = GHC.Show.showLitChar c
|
| otherwise = GHC.Show.showLitChar c
|
||||||
|
|
||||||
ppDecl q (_,id,typ)
|
ppDecl q (bt,id,typ)
|
||||||
| id == identW = ppTerm q 3 typ
|
| id == identW = ppTerm q 5 typ
|
||||||
| otherwise = parens (id <+> ':' <+> ppTerm q 0 typ)
|
| otherwise = parens (ppBind (bt,id) <+> ':' <+> ppTerm q 0 typ)
|
||||||
|
|
||||||
ppDDecl q (_,id,typ)
|
|
||||||
| id == identW = ppTerm q 6 typ
|
|
||||||
| otherwise = parens (id <+> ':' <+> ppTerm q 0 typ)
|
|
||||||
|
|
||||||
ppQIdent :: TermPrintQual -> QIdent -> Doc
|
ppQIdent :: TermPrintQual -> QIdent -> Doc
|
||||||
ppQIdent q (m,id) =
|
ppQIdent q (m,id) =
|
||||||
@@ -341,7 +337,7 @@ ppBind (Implicit,v) = braces v
|
|||||||
ppAltern q (x,y) = ppTerm q 0 x <+> '/' <+> ppTerm q 0 y
|
ppAltern q (x,y) = ppTerm q 0 x <+> '/' <+> ppTerm q 0 y
|
||||||
|
|
||||||
ppParams q ps = fsep (intersperse (pp '|') (map (ppParam q) ps))
|
ppParams q ps = fsep (intersperse (pp '|') (map (ppParam q) ps))
|
||||||
ppParam q (id,cxt) = id <+> hsep (map (ppDDecl q) cxt)
|
ppParam q (id,cxt) = id <+> hsep (map (ppDecl q) cxt)
|
||||||
|
|
||||||
ppMarkupAttr q (id,e) =
|
ppMarkupAttr q (id,e) =
|
||||||
id <> pp '=' <> ppTerm q 5 e
|
id <> pp '=' <> ppTerm q 5 e
|
||||||
|
|||||||
Reference in New Issue
Block a user