diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-10-13 02:39:12 +0300 |
---|---|---|
committer | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-10-17 13:38:35 -0400 |
commit | 02f5b644d89eaf7b356eb6728200f948dfb32f1b (patch) | |
tree | 4a27b63efbe4d89bc1e15d1b15afd5935beb2dce /ghc | |
parent | b02a9ea79dddd98f6bbb42e1652d7ea38db7d55e (diff) | |
download | haskell-wip/warn-operator-whitespace.tar.gz |
Implement -Woperator-whitespace (#18834)wip/warn-operator-whitespace
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.
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI/Tags.hs | 10 |
1 files changed, 5 insertions, 5 deletions
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 |