From b5b3e34ec39fc89a0bcd0b60cf9a4962c89ba72f Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Tue, 13 Oct 2020 02:39:12 +0300 Subject: Implement -Woperator-whitespace (#18834) This patch implements two related warnings: -Woperator-whitespace-ext-conflict warns on uses of infix operators that would be parsed differently were a particular GHC extension enabled -Woperator-whitespace warns on prefix, suffix, and tight infix uses of infix operators Updates submodules: haddock, containers. --- ghc/GHCi/UI/Tags.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ghc') diff --git a/ghc/GHCi/UI/Tags.hs b/ghc/GHCi/UI/Tags.hs index bc86f39766..53c33ccbfe 100644 --- a/ghc/GHCi/UI/Tags.hs +++ b/ghc/GHCi/UI/Tags.hs @@ -95,7 +95,7 @@ listModuleTags m = do dflags <- getDynFlags mb_print_unqual <- GHC.mkPrintUnqualifiedForModule mInfo let unqual = fromMaybe GHC.alwaysQualify mb_print_unqual - let names = fromMaybe [] $GHC.modInfoTopLevelScope mInfo + let names = fromMaybe [] $ GHC.modInfoTopLevelScope mInfo let localNames = filter ((m==) . nameModule) names mbTyThings <- mapM GHC.lookupName localNames return $! [ tagInfo dflags unqual exported kind name realLoc @@ -153,11 +153,11 @@ collateAndWriteTags CTagsWithLineNumbers file tagInfos = do -- ctags style with the Ex expression being a regex searching the line, Vim et al collateAndWriteTags CTagsWithRegExes file tagInfos = do -- ctags style, Vim et al tagInfoGroups <- makeTagGroupsWithSrcInfo tagInfos - let tags = unlines $ sort $ map showCTag $concat tagInfoGroups + let tags = unlines $ sort $ map showCTag $ concat tagInfoGroups tryIO (writeTagsSafely file tags) collateAndWriteTags ETags file tagInfos = do -- etags style, Emacs/XEmacs - tagInfoGroups <- makeTagGroupsWithSrcInfo $filter tagExported tagInfos + tagInfoGroups <- makeTagGroupsWithSrcInfo $ filter tagExported tagInfos let tagGroups = map processGroup tagInfoGroups tryIO (writeTagsSafely file $ concat tagGroups) @@ -176,7 +176,7 @@ makeTagGroupsWithSrcInfo tagInfos = do where addTagSrcInfo [] = throwGhcException (CmdLineError "empty tag file group??") addTagSrcInfo group@(tagInfo:_) = do - file <- readFile $tagFile tagInfo + file <- readFile $ tagFile tagInfo let sortedGroup = sortBy (comparing tagLine) group return $ perFile sortedGroup 1 0 $ lines file @@ -197,7 +197,7 @@ showCTag ti = where tagCmd = case tagSrcInfo ti of - Nothing -> show $tagLine ti + Nothing -> show $ tagLine ti Just (srcLine,_) -> "/^"++ foldr escapeSlashes [] srcLine ++"$/" where -- cgit v1.2.1