|
19 | 19 |
|
20 | 20 | module Distribution.PackageDescription.Parse (
|
21 | 21 | -- * Package descriptions
|
| 22 | + readGenericPackageDescription, |
| 23 | + parseGenericPackageDescription, |
| 24 | + |
| 25 | + -- ** Deprecated names |
22 | 26 | readPackageDescription,
|
23 | 27 | parsePackageDescription,
|
24 | 28 |
|
@@ -592,10 +596,14 @@ readHookedBuildInfo :: Verbosity -> FilePath -> IO HookedBuildInfo
|
592 | 596 | readHookedBuildInfo =
|
593 | 597 | readAndParseFile withFileContents parseHookedBuildInfo
|
594 | 598 |
|
595 |
| --- |Parse the given package file. |
596 | 599 | readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription
|
597 |
| -readPackageDescription = |
598 |
| - readAndParseFile withUTF8FileContents parsePackageDescription |
| 600 | +readPackageDescription = readGenericPackageDescription |
| 601 | +{-# DEPRECATED readPackageDescription "Use readGenericPackageDescription, old name is missleading." #-} |
| 602 | + |
| 603 | +-- | Parse the given package file. |
| 604 | +readGenericPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription |
| 605 | +readGenericPackageDescription = |
| 606 | + readAndParseFile withUTF8FileContents parseGenericPackageDescription |
599 | 607 |
|
600 | 608 | stanzas :: [Field] -> [[Field]]
|
601 | 609 | stanzas [] = []
|
@@ -713,12 +721,16 @@ skipField = modify tail
|
713 | 721 | --FIXME: this should take a ByteString, not a String. We have to be able to
|
714 | 722 | -- decode UTF8 and handle the BOM.
|
715 | 723 |
|
| 724 | +parsePackageDescription :: String -> ParseResult GenericPackageDescription |
| 725 | +parsePackageDescription = parseGenericPackageDescription |
| 726 | +{-# DEPRECATED parsePackageDescription "Use parseGenericPackageDescription, old name is missleading" #-} |
| 727 | + |
716 | 728 | -- | Parses the given file into a 'GenericPackageDescription'.
|
717 | 729 | --
|
718 | 730 | -- In Cabal 1.2 the syntax for package descriptions was changed to a format
|
719 | 731 | -- with sections and possibly indented property descriptions.
|
720 |
| -parsePackageDescription :: String -> ParseResult GenericPackageDescription |
721 |
| -parsePackageDescription file = do |
| 732 | +parseGenericPackageDescription :: String -> ParseResult GenericPackageDescription |
| 733 | +parseGenericPackageDescription file = do |
722 | 734 |
|
723 | 735 | -- This function is quite complex because it needs to be able to parse
|
724 | 736 | -- both pre-Cabal-1.2 and post-Cabal-1.2 files. Additionally, it contains
|
|
0 commit comments