@@ -1,5 +1,5 @@
2−Module : Pkg.PParser
2+Module : Idris.Package.Parser
3Description : `iPKG` file parser and package description information.
3Description : `iPKG` file parser and package description information.
5License : BSD3
5License : BSD3
@@ -9,7 +9,7 @@ Maintainer : The Idris Community.
9#if !(MIN_VERSION_base(4,8,0))
9#if !(MIN_VERSION_base(4,8,0))
10{-# LANGUAGE OverlappingInstances #-}
10{-# LANGUAGE OverlappingInstances #-}
12−module Pkg.PParser where
12+module Idris.Package.Parser where
14import Text.Trifecta hiding (span, charLiteral, natural, symbol, char, string, whiteSpace)
14import Text.Trifecta hiding (span, charLiteral, natural, symbol, char, string, whiteSpace)
15import qualified Text.PrettyPrint.ANSI.Leijen as PP
15import qualified Text.PrettyPrint.ANSI.Leijen as PP
@@ -19,6 +19,8 @@ import Idris.AbsSyntaxTree
19import Idris.Parser.Helpers hiding (stringLiteral)
19import Idris.Parser.Helpers hiding (stringLiteral)
20import Idris.CmdOptions
20import Idris.CmdOptions
22+import Idris.Package.Common
22import Control.Monad.State.Strict
24import Control.Monad.State.Strict
23import Control.Applicative
25import Control.Applicative
24import System.FilePath (takeFileName, isValid)
26import System.FilePath (takeFileName, isValid)
@@ -29,35 +31,6 @@ import Util.System
30type PParser = StateT PkgDesc IdrisInnerParser
32type PParser = StateT PkgDesc IdrisInnerParser
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.
55−-- | Default settings for package descriptions.
57−defaultPkg = PkgDesc "" [] Nothing Nothing Nothing Nothing
58− Nothing Nothing Nothing Nothing
59− Nothing [] [] Nothing [] "" [] (sUN "") Nothing []
61instance HasLastTokenSpan PParser where
34instance HasLastTokenSpan PParser where
62 getLastTokenSpan = return Nothing
35 getLastTokenSpan = return Nothing