| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Distribution.Client.Errors.Parser
Synopsis
- data CabalFileParseError = CabalFileParseError FilePath ByteString (NonEmpty (PErrorWithSource CabalFileSource)) (Maybe Version) [PWarningWithSource CabalFileSource]
- renderCabalFileParseError :: CabalFileParseError -> String
- data ProjectConfigParseError = ProjectConfigParseError (NonEmpty (PErrorWithSource ProjectFileSource)) [PWarningWithSource ProjectFileSource]
- renderProjectConfigParseError :: ProjectConfigParseError -> String
- data ProjectFileSource = ProjectFileSource (ProjectConfigPath, ByteString)
- renderProjectFileSource :: ProjectFileSource -> String
- renderParseErrorCabalFile :: NonEmpty (PErrorWithSource CabalFileSource) -> [PWarningWithSource CabalFileSource] -> String
- renderParseError :: Ord src => (src -> ([PError], [PWarning]) -> String) -> NonEmpty (PErrorWithSource src) -> [PWarningWithSource src] -> String
- renderParseErrorsWarnings :: PSource (([PError], [PWarning]) -> String) -> ([PError], [PWarning]) -> String
- renderCabalFileSourceMsgs :: CabalFileSource -> ([PError], [PWarning]) -> String
- renderInstalledPackageInfoSourceMsgs :: InstalledPackageInfoSource -> ([PError], [PWarning]) -> String
- renderParseErrorNoFile :: String -> [PError] -> [PWarning] -> String
- renderParseErrorFile :: String -> FilePath -> Maybe String -> ByteString -> ([PError], [PWarning]) -> String
- renderParseErrorGeneral :: String -> Maybe String -> Maybe String -> (Position -> [String]) -> [PError] -> [PWarning] -> String
- data Zipper a = Zipper [a] [a]
- listToZipper :: [a] -> Zipper a
- advance :: Int -> Zipper a -> Zipper a
Documentation
data CabalFileParseError Source #
Errors reported upon failing to parse a .cabal file.
Constructors
| CabalFileParseError | |
Fields
| |
Instances
| Exception CabalFileParseError Source # | |
Defined in Distribution.Client.Errors.Parser | |
| Show CabalFileParseError Source # | Manual instance which skips file contents |
Defined in Distribution.Client.Errors.Parser Methods showsPrec :: Int -> CabalFileParseError -> ShowS # show :: CabalFileParseError -> String # showList :: [CabalFileParseError] -> ShowS # | |
data ProjectConfigParseError Source #
Errors reported upon failing to parse a cabal.project file.
Constructors
| ProjectConfigParseError | |
Fields
| |
Instances
| Exception ProjectConfigParseError Source # | |
| Show ProjectConfigParseError Source # | Manual instance which skips file contents |
Defined in Distribution.Client.Errors.Parser Methods showsPrec :: Int -> ProjectConfigParseError -> ShowS # show :: ProjectConfigParseError -> String # showList :: [ProjectConfigParseError] -> ShowS # | |
data ProjectFileSource Source #
Constructors
| ProjectFileSource (ProjectConfigPath, ByteString) |
Instances
renderParseErrorCabalFile :: NonEmpty (PErrorWithSource CabalFileSource) -> [PWarningWithSource CabalFileSource] -> String Source #
renderParseError :: Ord src => (src -> ([PError], [PWarning]) -> String) -> NonEmpty (PErrorWithSource src) -> [PWarningWithSource src] -> String Source #
Render parse error highlighting the part of the input file.
renderParseErrorsWarnings :: PSource (([PError], [PWarning]) -> String) -> ([PError], [PWarning]) -> String Source #
renderCabalFileSourceMsgs :: CabalFileSource -> ([PError], [PWarning]) -> String Source #
renderInstalledPackageInfoSourceMsgs :: InstalledPackageInfoSource -> ([PError], [PWarning]) -> String Source #
Arguments
| :: String | Human name for the kind of file (i.e. cabal, project "file") |
| -> FilePath | Path to the file |
| -> Maybe String | Provenance, any additional contextual info to print |
| -> ByteString | Contents of the file |
| -> ([PError], [PWarning]) | |
| -> String |
Render a parse error which resulted from a file on disk
renderParseErrorGeneral Source #
Arguments
| :: String | What we were parsing when the error occurred. |
| -> Maybe String | A simpler/shorter header to display when displaying each error (normally a filepath) |
| -> Maybe String | Provenance, used to print additional context about what file failed (used to print the import path of a project file which failed to parse) |
| -> (Position -> [String]) | Extra information to render based on the position |
| -> [PError] | |
| -> [PWarning] | |
| -> String |
A generic rendering function which can render from many sources.
listToZipper :: [a] -> Zipper a Source #