summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser/PostProcess/Haddock.hs
diff options
context:
space:
mode:
authorAlfredo Di Napoli <alfredo@well-typed.com>2021-04-19 14:29:18 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-26 16:03:15 -0400
commitcdbce8fc22448837e53515946f16e9571e06f412 (patch)
treea07372a960e55eaeff036ed717272b47f821711b /compiler/GHC/Parser/PostProcess/Haddock.hs
parent2023b344a7567492881745609c494a9427dc8c30 (diff)
downloadhaskell-cdbce8fc22448837e53515946f16e9571e06f412.tar.gz
Support new parser types in GHC
This commit converts the lexers and all the parser machinery to use the new parser types and diagnostics infrastructure. Furthermore, it cleans up the way the parser code was emitting hints. As a result of this systematic approach, the test output of the `InfixAppPatErr` and `T984` tests have been changed. Previously they would emit a `SuggestMissingDo` hint, but this was not at all helpful in resolving the error, and it was even confusing by just looking at the original program that triggered the errors. Update haddock submodule
Diffstat (limited to 'compiler/GHC/Parser/PostProcess/Haddock.hs')
-rw-r--r--compiler/GHC/Parser/PostProcess/Haddock.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/GHC/Parser/PostProcess/Haddock.hs b/compiler/GHC/Parser/PostProcess/Haddock.hs
index 301e902f8b..88988b2ea6 100644
--- a/compiler/GHC/Parser/PostProcess/Haddock.hs
+++ b/compiler/GHC/Parser/PostProcess/Haddock.hs
@@ -54,7 +54,6 @@ import GHC.Prelude hiding (mod)
import GHC.Hs
import GHC.Types.SrcLoc
-import GHC.Driver.Flags ( WarningFlag(..) )
import GHC.Utils.Panic
import GHC.Data.Bag
@@ -71,7 +70,7 @@ import Data.Coerce
import qualified Data.Monoid
import GHC.Parser.Lexer
-import GHC.Parser.Errors
+import GHC.Parser.Errors.Types
import GHC.Utils.Misc (mergeListsBy, filterOut, mapLastM, (<&&>))
import qualified GHC.Data.Strict as Strict
@@ -193,9 +192,9 @@ addHaddockToModule lmod = do
reportHdkWarning :: HdkWarn -> P ()
reportHdkWarning (HdkWarnInvalidComment (L l _)) =
- addWarning Opt_WarnInvalidHaddock $ PsWarnHaddockInvalidPos (mkSrcSpanPs l)
+ addPsMessage (mkSrcSpanPs l) PsWarnHaddockInvalidPos
reportHdkWarning (HdkWarnExtraComment (L l _)) =
- addWarning Opt_WarnInvalidHaddock $ PsWarnHaddockIgnoreMulti l
+ addPsMessage l PsWarnHaddockIgnoreMulti
collectHdkWarnings :: HdkSt -> [HdkWarn]
collectHdkWarnings HdkSt{ hdk_st_pending, hdk_st_warnings } =