RecursiveDo: Add second layout, Respect IndentPolicyLeft

pull/66/head
Lennart Spitzner 2017-11-27 23:09:14 +01:00
parent 466ff237ff
commit d9155e240d
1 changed files with 21 additions and 6 deletions

View File

@ -91,12 +91,27 @@ layoutStmt lstmt@(L _ stmt) = do
(docSetBaseAndIndent $ docLines $ return <$> bindDocs) (docSetBaseAndIndent $ docLines $ return <$> bindDocs)
) )
] ]
RecStmt stmts _ _ _ _ _ _ _ _ _ -> do RecStmt stmts _ _ _ _ _ _ _ _ _ -> docAltFilter
docSeq [ -- rec stmt1
-- stmt2
-- stmt3
( indentPolicy /= IndentPolicyLeft
, docSeq
[ docLit (Text.pack "rec") [ docLit (Text.pack "rec")
, docSeparator , docSeparator
, docSetBaseAndIndent $ docLines $ layoutStmt <$> stmts , docSetBaseAndIndent $ docLines $ layoutStmt <$> stmts
] ]
)
, -- rec
-- stmt1
-- stmt2
-- stmt3
( True
, docAddBaseY BrIndentRegular $ docPar
(docLit (Text.pack "rec"))
(docLines $ layoutStmt <$> stmts)
)
]
BodyStmt expr _ _ _ -> do BodyStmt expr _ _ _ -> do
expDoc <- docSharedWrapper layoutExpr expr expDoc <- docSharedWrapper layoutExpr expr
docAddBaseY BrIndentRegular $ expDoc docAddBaseY BrIndentRegular $ expDoc