| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
HeaderInfo
Description
Parsing the top of a Haskell source file to get its module name, imports and options.
(c) Simon Marlow 2005 (c) Lemmih 2006
Synopsis
- getImports :: DynFlags -> StringBuffer -> FilePath -> FilePath -> IO ([(Maybe FastString, Located ModuleName)], [(Maybe FastString, Located ModuleName)], Located ModuleName)
- mkPrelImports :: ModuleName -> SrcSpan -> Bool -> [LImportDecl GhcPs] -> [LImportDecl GhcPs]
- getOptionsFromFile :: DynFlags -> FilePath -> IO [Located String]
- getOptions :: DynFlags -> StringBuffer -> FilePath -> [Located String]
- optionsErrorMsgs :: DynFlags -> [String] -> [Located String] -> FilePath -> Messages
- checkProcessArgsResult :: MonadIO m => DynFlags -> [Located String] -> m ()
Documentation
Arguments
Parse this.
Filename the buffer came from. Used for reporting parse error locations.
The original source filename (used for locations in the function result)
The source imports, normal imports, and the module name.
Parse the imports of a source file.
Throws a SourceError if parsing fails.
mkPrelImports :: ModuleName -> SrcSpan -> Bool -> [LImportDecl GhcPs] -> [LImportDecl GhcPs] Source #
Parse OPTIONS and LANGUAGE pragmas of the source file.
Throws a SourceError if flag parsing fails (including unsupported flags.)
Arguments
Input Buffer
Source filename. Used for location info.
Parse OPTIONS and LANGUAGE pragmas of the source file.
Throws a SourceError if flag parsing fails (including unsupported flags.)
checkProcessArgsResult :: MonadIO m => DynFlags -> [Located String] -> m () Source #
Complain about non-dynamic flags in OPTIONS pragmas.
Throws a SourceError if the input list is non-empty claiming that the
input flags are unknown.