Support mdo layouting (RecursiveDo)

pull/35/head
Lennart Spitzner 2017-06-29 18:13:28 +02:00
parent cece70380c
commit 0251062100
1 changed files with 7 additions and 0 deletions

View File

@ -547,6 +547,13 @@ layoutExpr lexpr@(L _ expr) = docWrapNode lexpr $ case expr of
$ docPar
(docLit $ Text.pack "do")
(docSetBaseAndIndent $ docNonBottomSpacing $ docLines stmtDocs)
HsDo MDoExpr (L _ stmts) _ -> do
stmtDocs <- docSharedWrapper layoutStmt `mapM` stmts
docSetParSpacing
$ docAddBaseY BrIndentRegular
$ docPar
(docLit $ Text.pack "mdo")
(docSetBaseAndIndent $ docNonBottomSpacing $ docLines stmtDocs)
HsDo x (L _ stmts) _ | case x of { ListComp -> True
; MonadComp -> True
; _ -> False } -> do