on master help sign in
Drop ‘normalizePragma’
94ef8f4mrkkrp
src/Ormolu/Parser/CommentStream.hs+1−10
@@ -56,8 +56,7 @@ mkCommentStream extraComments pstate =
56 -- NOTE It's easier to normalize pragmas right when we construct comment
56 -- NOTE It's easier to normalize pragmas right when we construct comment
57 -- streams. Because this way we need to do it only once and when we
57 -- streams. Because this way we need to do it only once and when we
58 -- perform checking later they'll automatically match.
58 -- perform checking later they'll automatically match.
59− mkComment . fmap normalizePragma
60− <$> sortOn (realSrcSpanStart . getLoc) comments
59+ mkComment <$> sortOn (realSrcSpanStart . getLoc) comments
61 , S.unions exts
60 , S.unions exts
62 )
61 )
63 where
62 where
@@ -85,14 +84,6 @@ showCommentStream (CommentStream xs) = unlines $
85----------------------------------------------------------------------------
84----------------------------------------------------------------------------
86-- Helpers
85-- Helpers
87
86
88−-- | Normalize pragmas by deleting extra white space.
89−
90−normalizePragma :: String -> String
91−normalizePragma x =
92− if "{-#" `isPrefixOf` x
93− then unwords (words x)
94− else x
95−
96-- | Normalize comment string. Sometimes one multi-line comment is turned
87-- | Normalize comment string. Sometimes one multi-line comment is turned
97-- into several lines for subsequent outputting with correct indentation for
88-- into several lines for subsequent outputting with correct indentation for
98-- each line.
89-- each line.