git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Drop non-pipe comments from the output
5ae2fc9Gary Burgess
psc-docs/Main.hs+3−6
@@ -158,18 +158,15 @@ renderDeclaration _ (P.TypeInstanceDeclaration name constraints className tys _)
158 fenced $ "instance " ++ show name ++ " :: " ++ constraintsText ++ show className ++ " " ++ unwords (map P.prettyPrintTypeAtom tys)
158 fenced $ "instance " ++ show name ++ " :: " ++ constraintsText ++ show className ++ " " ++ unwords (map P.prettyPrintTypeAtom tys)
159renderDeclaration exps (P.PositionedDeclaration _ com d) = do
159renderDeclaration exps (P.PositionedDeclaration _ com d) = do
160 renderDeclaration exps d
160 renderDeclaration exps d
161− spacer
162 renderComments com
161 renderComments com
163renderDeclaration _ _ = return ()
162renderDeclaration _ _ = return ()
164
163
165renderComments :: [P.Comment] -> Docs
164renderComments :: [P.Comment] -> Docs
166renderComments cs = do
165renderComments cs = do
167 let raw = concatMap toLines cs
166 let raw = concatMap toLines cs
168−
169− if all hasPipe raw
167+ when (all hasPipe raw) $ do
168+ spacer
170− then atIndent 0 . unlines . map stripPipes $ raw
169+ atIndent 0 . unlines . map stripPipes $ raw
171− else atIndent 4 $ unlines raw
172−
173 where
170 where
174
171
175 toLines (P.LineComment s) = [s]
172 toLines (P.LineComment s) = [s]