Add some comments/examples in layoutStmt

pull/66/head
Lennart Spitzner 2017-11-27 23:05:47 +01:00
parent 9e8571b848
commit 466ff237ff
1 changed files with 14 additions and 4 deletions

View File

@ -55,27 +55,37 @@ layoutStmt lstmt@(L _ stmt) = do
-- heh. -- heh.
Just [] -> docLit $ Text.pack "let" -- this probably never happens Just [] -> docLit $ Text.pack "let" -- this probably never happens
Just [bindDoc] -> docAltFilter Just [bindDoc] -> docAltFilter
[ ( indentPolicy /= IndentPolicyLeft [ -- let bind = expr
( indentPolicy /= IndentPolicyLeft
, docCols , docCols
ColDoLet ColDoLet
[ appSep $ docLit $ Text.pack "let" [ appSep $ docLit $ Text.pack "let"
, docSetBaseAndIndent $ return bindDoc , docSetBaseAndIndent $ return bindDoc
] ]
) )
, ( True , -- let
-- bind = expr
( True
, docAddBaseY BrIndentRegular $ docPar , docAddBaseY BrIndentRegular $ docPar
(docLit $ Text.pack "let") (docLit $ Text.pack "let")
(docSetBaseAndIndent $ return bindDoc) (docSetBaseAndIndent $ return bindDoc)
) )
] ]
Just bindDocs -> docAltFilter Just bindDocs -> docAltFilter
[ ( indentPolicy /= IndentPolicyLeft [ -- let aaa = expra
-- bbb = exprb
-- ccc = exprc
( indentPolicy /= IndentPolicyLeft
, docSeq , docSeq
[ appSep $ docLit $ Text.pack "let" [ appSep $ docLit $ Text.pack "let"
, docSetBaseAndIndent $ docLines $ return <$> bindDocs , docSetBaseAndIndent $ docLines $ return <$> bindDocs
] ]
) )
, ( True , -- let
-- aaa = expra
-- bbb = exprb
-- ccc = exprc
( True
, docAddBaseY BrIndentRegular $ docPar , docAddBaseY BrIndentRegular $ docPar
(docLit $ Text.pack "let") (docLit $ Text.pack "let")
(docSetBaseAndIndent $ docLines $ return <$> bindDocs) (docSetBaseAndIndent $ docLines $ return <$> bindDocs)