Copyright | Isaac Jones 2003-2005 |
---|---|
License | BSD3 |
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This defined parsers and partial pretty printers for the .cabal
format.
Some of the complexity in this module is due to the fact that we have to be
backwards compatible with old .cabal
files, so there's code to translate
into the newer structure.
- readGenericPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription
- parseGenericPackageDescription :: String -> ParseResult GenericPackageDescription
- readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription
- parsePackageDescription :: String -> ParseResult GenericPackageDescription
- data ParseResult a
- = ParseFailed PError
- | ParseOk [PWarning] a
- data FieldDescr a = FieldDescr {}
- type LineNo = Int
- data TestSuiteStanza = TestSuiteStanza {}
- data BenchmarkStanza = BenchmarkStanza {}
- readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo
- parseHookedBuildInfo :: String -> ParseResult HookedBuildInfo
- pkgDescrFieldDescrs :: [FieldDescr PackageDescription]
- libFieldDescrs :: [FieldDescr Library]
- foreignLibFieldDescrs :: [FieldDescr ForeignLib]
- executableFieldDescrs :: [FieldDescr Executable]
- binfoFieldDescrs :: [FieldDescr BuildInfo]
- sourceRepoFieldDescrs :: [FieldDescr SourceRepo]
- testSuiteFieldDescrs :: [FieldDescr TestSuiteStanza]
- benchmarkFieldDescrs :: [FieldDescr BenchmarkStanza]
- flagFieldDescrs :: [FieldDescr Flag]
Package descriptions
readGenericPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription #
Parse the given package file.
parseGenericPackageDescription :: String -> ParseResult GenericPackageDescription #
Parses the given file into a GenericPackageDescription
.
In Cabal 1.2 the syntax for package descriptions was changed to a format with sections and possibly indented property descriptions.
Deprecated names
readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription #
Deprecated: Use readGenericPackageDescription, old name is misleading.
parsePackageDescription :: String -> ParseResult GenericPackageDescription #
Deprecated: Use parseGenericPackageDescription, old name is misleading
Parsing
data ParseResult a #
data FieldDescr a #
Field descriptor. The parameter a
parameterizes over where the field's
value is stored in.
Private, but needed for pretty-printer
data TestSuiteStanza #
An intermediate type just used for parsing the test-suite stanza.
After validation it is converted into the proper TestSuite
type.
data BenchmarkStanza #
An intermediate type just used for parsing the benchmark stanza.
After validation it is converted into the proper Benchmark
type.
Supplementary build information
readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo #
libFieldDescrs :: [FieldDescr Library] #
flagFieldDescrs :: [FieldDescr Flag] #