on master help sign in
Drop ‘normalizePragma’

AFAIU it's not used anymore because we handle LANGUAGE pragmas specially while all other pragmas are parsed properly and do not end up as comments.

commit94ef8f4f75cfc17f2f5e3948fbd194072830bbe8 authormrkkrp <mark.karpov@tweag.io> dateFri 5 Jul 2019, 21:04 (7 years ago) parent875c79d
1 file changed+1−10
src/Ormolu/Parser/CommentStream.hs+1−10
src/Ormolu/Parser/CommentStream.hs+1−10
@@ -56,8 +56,7 @@ mkCommentStream extraComments pstate =
5656 -- NOTE It's easier to normalize pragmas right when we construct comment
5757 -- streams. Because this way we need to do it only once and when we
5858 -- perform checking later they'll automatically match.
59− mkComment . fmap normalizePragma
60− <$> sortOn (realSrcSpanStart . getLoc) comments
59+ mkComment <$> sortOn (realSrcSpanStart . getLoc) comments
6160 , S.unions exts
6261 )
6362 where
@@ -85,14 +84,6 @@ showCommentStream (CommentStream xs) = unlines $
8584----------------------------------------------------------------------------
8685-- Helpers
8786
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−
9687-- | Normalize comment string. Sometimes one multi-line comment is turned
9788-- into several lines for subsequent outputting with correct indentation for
9889-- each line.