summaryrefslogtreecommitdiff
path: root/compiler/GHC.hs
diff options
context:
space:
mode:
authorAlfredo Di Napoli <alfredo@well-typed.com>2021-06-30 15:17:46 +0200
committerAlfredo Di Napoli <alfredo@well-typed.com>2021-07-08 08:13:23 +0200
commit56eb57a6b348d44370fc84f6a35caabd1c548b5e (patch)
treebe873cadaa3f9ec47c41546d2577d61810038313 /compiler/GHC.hs
parent5a31abe3544c21d0b45d264ea68f89bbb108251d (diff)
downloadhaskell-56eb57a6b348d44370fc84f6a35caabd1c548b5e.tar.gz
Rename getErrorMessages and getMessages function in parser codewip/adinapoli-issue-19920
This commit renames the `getErrorMessages` and `getMessages` function in the parser code to `getPsErrorMessages` and `getPsMessages`, to avoid import conflicts, as we have already `getErrorMessages` and `getMessages` defined in `GHC.Types.Error`. Fixes #19920. Update haddock submodule
Diffstat (limited to 'compiler/GHC.hs')
-rw-r--r--compiler/GHC.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs
index 2b5f3e06d5..ea1293f2a8 100644
--- a/compiler/GHC.hs
+++ b/compiler/GHC.hs
@@ -381,7 +381,7 @@ import GHC.Types.Name.Set
import GHC.Types.Name.Reader
import GHC.Types.SourceError
import GHC.Types.SafeHaskell
-import GHC.Types.Error hiding ( getMessages, getErrorMessages )
+import GHC.Types.Error
import GHC.Types.Fixity
import GHC.Types.Target
import GHC.Types.Basic
@@ -1583,7 +1583,7 @@ getTokenStream mod = do
let startLoc = mkRealSrcLoc (mkFastString sourceFile) 1 1
case lexTokenStream (initParserOpts dflags) source startLoc of
POk _ ts -> return ts
- PFailed pst -> throwErrors (GhcPsMessage <$> getErrorMessages pst)
+ PFailed pst -> throwErrors (GhcPsMessage <$> getPsErrorMessages pst)
-- | Give even more information on the source than 'getTokenStream'
-- This function allows reconstructing the source completely with
@@ -1594,7 +1594,7 @@ getRichTokenStream mod = do
let startLoc = mkRealSrcLoc (mkFastString sourceFile) 1 1
case lexTokenStream (initParserOpts dflags) source startLoc of
POk _ ts -> return $ addSourceToTokens startLoc source ts
- PFailed pst -> throwErrors (GhcPsMessage <$> getErrorMessages pst)
+ PFailed pst -> throwErrors (GhcPsMessage <$> getPsErrorMessages pst)
-- | Given a source location and a StringBuffer corresponding to this
-- location, return a rich token stream with the source associated to the
@@ -1773,11 +1773,11 @@ parser str dflags filename =
case unP Parser.parseModule (initParserState (initParserOpts dflags) buf loc) of
PFailed pst ->
- let (warns,errs) = getMessages pst in
+ let (warns,errs) = getPsMessages pst in
(GhcPsMessage <$> warns, Left $ GhcPsMessage <$> errs)
POk pst rdr_module ->
- let (warns,_) = getMessages pst in
+ let (warns,_) = getPsMessages pst in
(GhcPsMessage <$> warns, Right rdr_module)
-- -----------------------------------------------------------------------------