projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove prefixMatch and suffixMatch from Util
[ghc-hetmet.git]
/
compiler
/
main
/
HeaderInfo.hs
diff --git
a/compiler/main/HeaderInfo.hs
b/compiler/main/HeaderInfo.hs
index
090af1f
..
233ed1c
100644
(file)
--- a/
compiler/main/HeaderInfo.hs
+++ b/
compiler/main/HeaderInfo.hs
@@
-15,8
+15,7
@@
module HeaderInfo ( getImportsFromFile, getImports
#include "HsVersions.h"
import Parser ( parseHeader )
#include "HsVersions.h"
import Parser ( parseHeader )
-import Lexer ( P(..), ParseResult(..), mkPState, pragState
- , lexer, Token(..), PState(..) )
+import Lexer
import FastString
import HsSyn ( ImportDecl(..), HsModule(..) )
import Module ( ModuleName, moduleName )
import FastString
import HsSyn ( ImportDecl(..), HsModule(..) )
import Module ( ModuleName, moduleName )
@@
-24,8
+23,7
@@
import PrelNames ( gHC_PRIM, mAIN_NAME )
import StringBuffer ( StringBuffer(..), hGetStringBuffer, hGetStringBufferBlock
, appendStringBuffers )
import SrcLoc
import StringBuffer ( StringBuffer(..), hGetStringBuffer, hGetStringBufferBlock
, appendStringBuffers )
import SrcLoc
-import FastString ( mkFastString )
-import DynFlags ( DynFlags )
+import DynFlags
import ErrUtils
import Util
import Outputable
import ErrUtils
import Util
import Outputable
@@
-37,6
+35,8
@@
import Bag ( emptyBag, listToBag )
import Distribution.Compiler
import Control.Exception
import Distribution.Compiler
import Control.Exception
+import Control.Monad
+import System.Exit
import System.IO
import Data.List
import System.IO
import Data.List
@@
-65,7
+65,10
@@
getImports dflags buf filename = do
let loc = mkSrcLoc (mkFastString filename) 1 0
case unP parseHeader (mkPState buf loc dflags) of
PFailed span err -> parseError span err
let loc = mkSrcLoc (mkFastString filename) 1 0
case unP parseHeader (mkPState buf loc dflags) of
PFailed span err -> parseError span err
- POk _ rdr_module ->
+ POk pst rdr_module -> do
+ let ms = getMessages pst
+ printErrorsAndWarnings dflags ms
+ when (errorsFound dflags ms) $ exitWith (ExitFailure 1)
case rdr_module of
L _ (HsModule mb_mod _ imps _ _ _ _ _) ->
let
case rdr_module of
L _ (HsModule mb_mod _ imps _ _ _ _ _) ->
let