@@ -1,5 +1,5 @@
11{-|
2−Module : Pkg.PParser
2+Module : Idris.Package.Parser
33Description : `iPKG` file parser and package description information.
44Copyright :
55License : BSD3
@@ -9,7 +9,7 @@ Maintainer : The Idris Community.
99#if !(MIN_VERSION_base(4,8,0))
1010{-# LANGUAGE OverlappingInstances #-}
1111#endif
12−module Pkg.PParser where
12+module Idris.Package.Parser where
1313
1414import Text.Trifecta hiding (span, charLiteral, natural, symbol, char, string, whiteSpace)
1515import qualified Text.PrettyPrint.ANSI.Leijen as PP
@@ -19,6 +19,8 @@ import Idris.AbsSyntaxTree
1919import Idris.Parser.Helpers hiding (stringLiteral)
2020import Idris.CmdOptions
2121
22+import Idris.Package.Common
23+
2224import Control.Monad.State.Strict
2325import Control.Applicative
2426import System.FilePath (takeFileName, isValid)
@@ -29,35 +31,6 @@ import Util.System
2931
3032type PParser = StateT PkgDesc IdrisInnerParser
3133
32−data PkgDesc = PkgDesc {
33− pkgname :: String -- ^ Name associated with a package.
34− , pkgdeps :: [String] -- ^ List of packages this package depends on.
35− , pkgbrief :: Maybe String -- ^ Brief description of the package.
36− , pkgversion :: Maybe String -- ^ Version string to associate with the package.
37− , pkgreadme :: Maybe String -- ^ Location of the README file.
38− , pkglicense :: Maybe String -- ^ Description of the licensing information.
39− , pkgauthor :: Maybe String -- ^ Author information.
40− , pkgmaintainer :: Maybe String -- ^ Maintainer information.
41− , pkghomepage :: Maybe String -- ^ Website associated with the package.
42− , pkgsourceloc :: Maybe String -- ^ Location of the source files.
43− , pkgbugtracker :: Maybe String -- ^ Location of the project's bug tracker.
44− , libdeps :: [String] -- ^ External dependencies.
45− , objs :: [String] -- ^ Object files required by the package.
46− , makefile :: Maybe String -- ^ Makefile used to build external code. Used as part of the FFI process.
47− , idris_opts :: [Opt] -- ^ List of options to give the compiler.
48− , sourcedir :: String -- ^ Source directory for Idris files.
49− , modules :: [Name] -- ^ Modules provided by the package.
50− , idris_main :: Name -- ^ If an executable in which module can the Main namespace and function be found.
51− , execout :: Maybe String -- ^ What to call the executable.
52− , idris_tests :: [Name] -- ^ Lists of tests to execute against the package.
53− } deriving (Show)
54−
55−-- | Default settings for package descriptions.
56−defaultPkg :: PkgDesc
57−defaultPkg = PkgDesc "" [] Nothing Nothing Nothing Nothing
58− Nothing Nothing Nothing Nothing
59− Nothing [] [] Nothing [] "" [] (sUN "") Nothing []
60−
6134instance HasLastTokenSpan PParser where
6235 getLastTokenSpan = return Nothing
6336