git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Drop non-pipe comments from the output
commit5ae2fc924f66b2d52dd2ffb95b8211998b63ac29 authorGary Burgess <gary.burgess@gmail.com> dateSat 21 Feb 2015, 02:01 (12 years ago) parent84193e2
1 file changed+3−6
psc-docs/Main.hs+3−6
psc-docs/Main.hs+3−6
@@ -158,18 +158,15 @@ renderDeclaration _ (P.TypeInstanceDeclaration name constraints className tys _)
158158 fenced $ "instance " ++ show name ++ " :: " ++ constraintsText ++ show className ++ " " ++ unwords (map P.prettyPrintTypeAtom tys)
159159renderDeclaration exps (P.PositionedDeclaration _ com d) = do
160160 renderDeclaration exps d
161− spacer
162161 renderComments com
163162renderDeclaration _ _ = return ()
164163
165164renderComments :: [P.Comment] -> Docs
166165renderComments cs = do
167166 let raw = concatMap toLines cs
168−
169− if all hasPipe raw
170− then atIndent 0 . unlines . map stripPipes $ raw
171− else atIndent 4 $ unlines raw
172−
167+ when (all hasPipe raw) $ do
168+ spacer
169+ atIndent 0 . unlines . map stripPipes $ raw
173170 where
174171
175172 toLines (P.LineComment s) = [s]