Fix HsPar comment placement bug (see #111)

pull/132/head
Lennart Spitzner 2018-03-23 17:11:39 +01:00
parent 3847325fd5
commit bdd3b155f3
2 changed files with 11 additions and 1 deletions

View File

@ -569,3 +569,13 @@ a :: () ':- ()
func = do func = do
createDirectoryIfMissing True path createDirectoryIfMissing True path
openFile fileName AppendMode openFile fileName AppendMode
#test hspar-comments
alternatives :: Parser (Maybe Text)
alternatives = -- a
( -- b
alternativeOne -- c
<|> alterantiveTwo -- d
<|> alternativeThree -- e
) -- f

View File

@ -327,7 +327,7 @@ layoutExpr lexpr@(L _ expr) = do
, opDoc , opDoc
] ]
HsPar innerExp -> do HsPar innerExp -> do
innerExpDoc <- docSharedWrapper layoutExpr innerExp innerExpDoc <- docSharedWrapper (docWrapNode lexpr . layoutExpr) innerExp
docAlt docAlt
[ docSeq [ docSeq
[ docLit $ Text.pack "(" [ docLit $ Text.pack "("