diff options
author | Jakob Brünker <jakob.bruenker@gmail.com> | 2022-03-18 17:56:07 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-30 03:10:33 -0400 |
commit | f07c7766663fa52a037aaf941fd0d34523ff2f2f (patch) | |
tree | de3288beb918e3fbe0d053ffc9bbadaed9f38477 /compiler/GHC/Plugins.hs | |
parent | dda46e2da13268c239db3290720b014cef00c01d (diff) | |
download | haskell-f07c7766663fa52a037aaf941fd0d34523ff2f2f.tar.gz |
Give parsing plugins access to errors
Previously, when the parser produced non-fatal errors (i.e. it produced
errors but the 'PState' is 'POk'), compilation would be aborted before
the 'parsedResultAction' of any plugin was invoked. This commit changes
that, so that such that 'parsedResultAction' gets collections of
warnings and errors as argument, and must return them after potentially
modifying them.
Closes #20803
Diffstat (limited to 'compiler/GHC/Plugins.hs')
-rw-r--r-- | compiler/GHC/Plugins.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/GHC/Plugins.hs b/compiler/GHC/Plugins.hs index 95ae21aba7..2de8d8d370 100644 --- a/compiler/GHC/Plugins.hs +++ b/compiler/GHC/Plugins.hs @@ -58,6 +58,9 @@ module GHC.Plugins , module GHC.Unit.Module.ModIface , module GHC.Types.Meta , module GHC.Types.SourceError + , module GHC.Parser.Errors.Types + , module GHC.Types.Error + , module GHC.Hs , -- * Getting 'Name's thNameToGhcName ) @@ -140,6 +143,11 @@ import GHC.Tc.Utils.Env ( lookupGlobal ) import GHC.Tc.Errors.Hole.FitTypes +-- For parse result plugins +import GHC.Parser.Errors.Types ( PsWarning, PsError ) +import GHC.Types.Error ( Messages ) +import GHC.Hs ( HsParsedModule ) + import qualified Language.Haskell.TH as TH {- This instance is defined outside GHC.Core.Opt.Monad so that |