@@ -13,9 +13,10 @@ import Idris.Imports
13import Idris.Options (Opt)
13import Idris.Options (Opt)
14import Idris.Package.Common
14import Idris.Package.Common
15import Idris.Parser (moduleName)
15import Idris.Parser (moduleName)
16−import Idris.Parser.Helpers (Parser, Parsing, eol, iName, identifier, isEol,
16+import Idris.Parser.Helpers (Parser, Parsing, eol, iName, identifier,
17+ identifierWithExtraChars, isEol, lchar,
17− lchar, packageName, parseErrorDoc, reserved,
18+ packageName, parseErrorDoc, reserved, runparser,
18− runparser, someSpace, stringLiteral)
19+ someSpace, stringLiteral)
20import Control.Applicative
21import Control.Applicative
21import Control.Monad.State.Strict
22import Control.Monad.State.Strict
@@ -119,6 +120,9 @@ pOptions = do
119 Opts.Failure e -> fail $ fst $ Opts.renderFailure e ""
120 Opts.Failure e -> fail $ fst $ Opts.renderFailure e ""
120 _ -> fail "Unexpected error"
121 _ -> fail "Unexpected error"
123+libIdentifier :: Parsing m => m String
124+libIdentifier = identifierWithExtraChars "_'-."
122pClause :: PParser ()
126pClause :: PParser ()
123pClause = clause "executable" filename (\st v -> st { execout = Just v })
127pClause = clause "executable" filename (\st v -> st { execout = Just v })
124 <|> clause "main" (iName []) (\st v -> st { idris_main = Just v })
128 <|> clause "main" (iName []) (\st v -> st { idris_main = Just v })
@@ -129,7 +133,7 @@ pClause = clause "executable" filename (\st v -> st { execout = Just v })
129 in st { pkgdeps = ps `union` pkgdeps st
133 in st { pkgdeps = ps `union` pkgdeps st
130 , idris_opts = pkgs ++ idris_opts st })
134 , idris_opts = pkgs ++ idris_opts st })
131 <|> clause "modules" (commaSep moduleName) (\st v -> st { modules = modules st ++ v })
135 <|> clause "modules" (commaSep moduleName) (\st v -> st { modules = modules st ++ v })
132− <|> clause "libs" (commaSep identifier) (\st v -> st { libdeps = libdeps st ++ v })
136+ <|> clause "libs" (commaSep libIdentifier) (\st v -> st { libdeps = libdeps st ++ v })
133 <|> clause "objs" (commaSep identifier) (\st v -> st { objs = objs st ++ v })
137 <|> clause "objs" (commaSep identifier) (\st v -> st { objs = objs st ++ v })
134 <|> clause "makefile" (iName []) (\st v -> st { makefile = Just (show v) })
138 <|> clause "makefile" (iName []) (\st v -> st { makefile = Just (show v) })
135 <|> clause "tests" (commaSep (iName [])) (\st v -> st { idris_tests = idris_tests st ++ v })
139 <|> clause "tests" (commaSep (iName [])) (\st v -> st { idris_tests = idris_tests st ++ v })
@@ -142,3 +146,4 @@ pClause = clause "executable" filename (\st v -> st { execout = Just v })
142 <|> clause "brief" stringLiteral (\st v -> st { pkgbrief = Just v })
146 <|> clause "brief" stringLiteral (\st v -> st { pkgbrief = Just v })
143 <|> clause "author" textUntilEol (\st v -> st { pkgauthor = Just v })
147 <|> clause "author" textUntilEol (\st v -> st { pkgauthor = Just v })
144 <|> clause "maintainer" textUntilEol (\st v -> st { pkgmaintainer = Just v })
148 <|> clause "maintainer" textUntilEol (\st v -> st { pkgmaintainer = Just v })