#include "HsVersions.h"
+import HscTypes
import Parser ( parseHeader )
import Lexer
import FastString
in
return (source_imps, ordinary_imps, mod)
-parseError :: SrcSpan -> Message -> a
-parseError span err = throwErrMsg $ mkPlainErrMsg span err
+parseError :: SrcSpan -> Message -> IO a
+parseError span err = throwOneError $ mkPlainErrMsg span err
-- we aren't interested in package imports here, filter them out
isHomeImp :: ImportDecl name -> Bool
-----------------------------------------------------------------------------
-- Complain about non-dynamic flags in OPTIONS pragmas
-checkProcessArgsResult :: [String] -> FilePath -> IO ()
-checkProcessArgsResult flags filename
- = do when (notNull flags) (ghcError (ProgramError (
- showSDoc (hang (text filename <> char ':')
- 4 (text "unknown flags in {-# OPTIONS #-} pragma:" <+>
- hsep (map text flags)))
- )))
+checkProcessArgsResult :: [Located String] -> IO ()
+checkProcessArgsResult flags
+ = when (notNull flags) $
+ ghcError $ ProgramError $ showSDoc $ vcat $ map f flags
+ where f (L loc flag)
+ = hang (ppr loc <> char ':') 4
+ (text "unknown flag in {-# OPTIONS #-} pragma:" <+>
+ text flag)
-----------------------------------------------------------------------------