Make if-then-layout layout more consistent
parent
5bee3fa93d
commit
7c329d391b
|
@ -588,7 +588,7 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
, docForceParSpacing thenExprDoc
|
, docForceParSpacing thenExprDoc
|
||||||
]
|
]
|
||||||
, docAddBaseY BrIndentRegular
|
, docAddBaseY BrIndentRegular
|
||||||
$ docPar (thenDoc) thenExprDoc
|
$ docPar thenDoc thenExprDoc
|
||||||
]
|
]
|
||||||
, docAddBaseY BrIndentRegular $ docNonBottomSpacing $ docAlt
|
, docAddBaseY BrIndentRegular $ docNonBottomSpacing $ docAlt
|
||||||
[ docSeq
|
[ docSeq
|
||||||
|
@ -617,48 +617,30 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
-- else
|
-- else
|
||||||
-- stuff
|
-- stuff
|
||||||
-- note that this does _not_ have par-spacing
|
-- note that this does _not_ have par-spacing
|
||||||
addAlternative $ docAddBaseY BrIndentRegular $ docPar
|
addAlternative $ docPar
|
||||||
(docAddBaseY maySpecialIndent $ docSeq
|
(docAddBaseY maySpecialIndent $ docSeq
|
||||||
[ -- TODO92 docNodeAnnKW lexpr Nothing $
|
[ appSep $ ifDoc
|
||||||
appSep $ ifDoc
|
, ifExprDoc
|
||||||
, -- TODO92 docNodeAnnKW lexpr (Just AnnIf) $
|
|
||||||
ifExprDoc
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
(docLines
|
(docLines
|
||||||
[ docAddBaseY BrIndentRegular
|
[ docAddBaseY BrIndentRegular
|
||||||
-- TODO92 $ docNodeAnnKW lexpr (Just AnnThen)
|
|
||||||
$ docAlt
|
$ docAlt
|
||||||
[ docSeq
|
[ docSeq
|
||||||
[ appSep $ thenDoc
|
[ appSep $ thenDoc
|
||||||
, docForceParSpacing thenExprDoc
|
, docForceParSpacing thenExprDoc
|
||||||
]
|
]
|
||||||
, docAddBaseY BrIndentRegular
|
, docPar thenDoc thenExprDoc
|
||||||
$ docPar (thenDoc) thenExprDoc
|
|
||||||
]
|
]
|
||||||
, docAddBaseY BrIndentRegular $ docAlt
|
, docAddBaseY BrIndentRegular $ docAlt
|
||||||
[ docSeq
|
[ docSeq
|
||||||
[ appSep $ elseDoc
|
[ appSep $ elseDoc
|
||||||
, docForceParSpacing elseExprDoc
|
, docForceParSpacing elseExprDoc
|
||||||
]
|
]
|
||||||
, docAddBaseY BrIndentRegular
|
, docPar elseDoc elseExprDoc
|
||||||
$ docPar elseDoc elseExprDoc
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
addAlternative $ docSetBaseY $ docLines
|
|
||||||
[ docAddBaseY maySpecialIndent $ docSeq
|
|
||||||
[ -- TODO92 docNodeAnnKW lexpr Nothing $
|
|
||||||
appSep $ ifDoc
|
|
||||||
, -- TODO92 docNodeAnnKW lexpr (Just AnnIf) $
|
|
||||||
ifExprDoc
|
|
||||||
]
|
|
||||||
, -- TODO92 docNodeAnnKW lexpr (Just AnnThen) $
|
|
||||||
docAddBaseY BrIndentRegular
|
|
||||||
$ docPar (thenDoc) thenExprDoc
|
|
||||||
, docAddBaseY BrIndentRegular
|
|
||||||
$ docPar elseDoc elseExprDoc
|
|
||||||
]
|
|
||||||
HsMultiIf epAnn cases -> do
|
HsMultiIf epAnn cases -> do
|
||||||
binderDoc <- docLit $ Text.pack "->"
|
binderDoc <- docLit $ Text.pack "->"
|
||||||
let hasComments =
|
let hasComments =
|
||||||
|
|
Loading…
Reference in New Issue