From 94ef8f4f75cfc17f2f5e3948fbd194072830bbe8 Mon Sep 17 00:00:00 2001 From: mrkkrp Date: Fri, 5 Jul 2019 21:04:46 +0200 Subject: [PATCH] =?UTF-8?q?Drop=20=E2=80=98normalizePragma=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/Ormolu/Parser/CommentStream.hs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Ormolu/Parser/CommentStream.hs b/src/Ormolu/Parser/CommentStream.hs index e3aaf6f..679e83e 100644 --- a/src/Ormolu/Parser/CommentStream.hs +++ b/src/Ormolu/Parser/CommentStream.hs @@ -56,8 +56,7 @@ mkCommentStream extraComments pstate = -- NOTE It's easier to normalize pragmas right when we construct comment -- streams. Because this way we need to do it only once and when we -- perform checking later they'll automatically match. - mkComment . fmap normalizePragma - <$> sortOn (realSrcSpanStart . getLoc) comments + mkComment <$> sortOn (realSrcSpanStart . getLoc) comments , S.unions exts ) where @@ -85,14 +84,6 @@ showCommentStream (CommentStream xs) = unlines $ ---------------------------------------------------------------------------- -- Helpers --- | Normalize pragmas by deleting extra white space. - -normalizePragma :: String -> String -normalizePragma x = - if "{-#" `isPrefixOf` x - then unwords (words x) - else x - -- | Normalize comment string. Sometimes one multi-line comment is turned -- into several lines for subsequent outputting with correct indentation for -- each line.