add missing parens in pretty printer

This commit is contained in:
rhiannon morris 2023-08-12 10:24:59 +02:00
parent c6006682ca
commit 00d92d3f25

View file

@ -426,17 +426,19 @@ prettyTerm dnames tnames (Enum cases _) =
prettyTerm dnames tnames (Tag tag _) = prettyTerm dnames tnames (Tag tag _) =
prettyTag tag prettyTag tag
prettyTerm dnames tnames (Eq (S _ (N ty)) l r _) = do prettyTerm dnames tnames (Eq (S _ (N ty)) l r _) =
l <- withPrec InEq $ prettyTerm dnames tnames l parensIfM Eq =<< do
r <- withPrec InEq $ prettyTerm dnames tnames r l <- withPrec InEq $ prettyTerm dnames tnames l
ty <- withPrec InEq $ prettyTerm dnames tnames ty r <- withPrec InEq $ prettyTerm dnames tnames r
pure $ sep [l <++> !eqndD, r <++> !colonD, ty] ty <- withPrec InEq $ prettyTerm dnames tnames ty
pure $ sep [l <++> !eqndD, r <++> !colonD, ty]
prettyTerm dnames tnames (Eq ty l r _) = do prettyTerm dnames tnames (Eq ty l r _) =
ty <- prettyTypeLine dnames tnames ty parensIfM Arg =<< do
l <- withPrec Arg $ prettyTerm dnames tnames l ty <- prettyTypeLine dnames tnames ty
r <- withPrec Arg $ prettyTerm dnames tnames r l <- withPrec Arg $ prettyTerm dnames tnames l
prettyAppD !eqD [ty, l, r] r <- withPrec Arg $ prettyTerm dnames tnames r
prettyAppD !eqD [ty, l, r]
prettyTerm dnames tnames s@(DLam {}) = prettyTerm dnames tnames s@(DLam {}) =
prettyLambda dnames tnames s prettyLambda dnames tnames s