Commit 7d3b8936 authored by Alexis Williams's avatar Alexis Williams
Browse files

Expose `parseGhcEnvironmentFile`.

parent c434e82f
......@@ -60,6 +60,7 @@ module Distribution.Simple.GHC (
Internal.writeGhcEnvironmentFile,
Internal.ghcPlatformAndVersionString,
readGhcEnvironmentFile,
parseGhcEnvironmentFile,
ParseErrorExc(..),
-- * Version-specific implementation quirks
getImplInfo,
......
......@@ -5,7 +5,7 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
module Distribution.Simple.GHC.EnvironmentParser
( readGhcEnvironmentFile, ParseErrorExc(..) ) where
( parseGhcEnvironmentFile, readGhcEnvironmentFile, ParseErrorExc(..) ) where
import Prelude ()
import Distribution.Compat.Prelude
......@@ -42,10 +42,10 @@ newtype ParseErrorExc = ParseErrorExc P.ParseError
instance Exception ParseErrorExc
parseEnvironmentFile :: Parser [GhcEnvironmentFileEntry]
parseEnvironmentFile = parseEnvironmentFileLine `P.sepEndBy` P.endOfLine <* P.eof
parseGhcEnvironmentFile :: Parser [GhcEnvironmentFileEntry]
parseGhcEnvironmentFile = parseEnvironmentFileLine `P.sepEndBy` P.endOfLine <* P.eof
readGhcEnvironmentFile :: FilePath -> IO [GhcEnvironmentFileEntry]
readGhcEnvironmentFile path =
either (throwIO . ParseErrorExc) return =<<
parseFromFile parseEnvironmentFile path
parseFromFile parseGhcEnvironmentFile path
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment