Skip to content

Commit

Permalink
Drop non-pipe comments from the output
Browse files Browse the repository at this point in the history
  • Loading branch information
garyb committed Feb 21, 2015
1 parent 84193e2 commit 5ae2fc9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions psc-docs/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,15 @@ renderDeclaration _ (P.TypeInstanceDeclaration name constraints className tys _)
fenced $ "instance " ++ show name ++ " :: " ++ constraintsText ++ show className ++ " " ++ unwords (map P.prettyPrintTypeAtom tys)
renderDeclaration exps (P.PositionedDeclaration _ com d) = do
renderDeclaration exps d
spacer
renderComments com
renderDeclaration _ _ = return ()

renderComments :: [P.Comment] -> Docs
renderComments cs = do
let raw = concatMap toLines cs

if all hasPipe raw
then atIndent 0 . unlines . map stripPipes $ raw
else atIndent 4 $ unlines raw

when (all hasPipe raw) $ do
spacer
atIndent 0 . unlines . map stripPipes $ raw
where

toLines (P.LineComment s) = [s]
Expand Down

0 comments on commit 5ae2fc9

Please sign in to comment.