Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
c434e82f
Commit
c434e82f
authored
Jul 07, 2018
by
Alexis Williams
Browse files
Fix incorrect environment parser
parent
edf0e2ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Cabal/Distribution/Simple/GHC/EnvironmentParser.hs
View file @
c434e82f
...
...
@@ -30,11 +30,11 @@ parseEnvironmentFileLine = GhcEnvFileComment <$> comment
<|>
pure
GhcEnvFileClearPackageDbStack
<*
clearDb
where
comment
=
P
.
string
"--"
*>
P
.
many
(
P
.
noneOf
"
\r\n
"
)
unitId
=
P
.
string
"package-id"
*>
P
.
spaces
*>
unitId
=
P
.
try
$
P
.
string
"package-id"
*>
P
.
spaces
*>
(
mkUnitId
<$>
P
.
many1
(
P
.
satisfy
$
\
c
->
isAlphaNum
c
||
c
`
elem
`
"-_.+"
))
packageDb
=
(
P
.
string
"global-package-db"
*>
pure
GlobalPackageDB
)
<|>
(
P
.
string
"user-package-db"
*>
pure
UserPackageDB
)
<|>
(
P
.
string
"package-db"
*>
P
.
spaces
*>
(
SpecificPackageDB
<$>
P
.
any
Char
`
P
.
endBy
`
P
.
endOfLine
))
<|>
(
P
.
string
"package-db"
*>
P
.
spaces
*>
(
SpecificPackageDB
<$>
P
.
m
any
1
(
P
.
noneOf
"
\r\n
"
)
<*
P
.
lookAhead
P
.
endOfLine
))
clearDb
=
P
.
string
"clear-package-db"
newtype
ParseErrorExc
=
ParseErrorExc
P
.
ParseError
...
...
@@ -43,7 +43,7 @@ newtype ParseErrorExc = ParseErrorExc P.ParseError
instance
Exception
ParseErrorExc
parseEnvironmentFile
::
Parser
[
GhcEnvironmentFileEntry
]
parseEnvironmentFile
=
parseEnvironmentFileLine
`
P
.
e
ndBy
`
P
.
endOfLine
parseEnvironmentFile
=
parseEnvironmentFileLine
`
P
.
sepE
ndBy
`
P
.
endOfLine
<*
P
.
eof
readGhcEnvironmentFile
::
FilePath
->
IO
[
GhcEnvironmentFileEntry
]
readGhcEnvironmentFile
path
=
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment