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
bba80735
Commit
bba80735
authored
Feb 11, 2008
by
nominolo@gmail.com
Browse files
Allow lower-case spellings for boolean fields.
parent
39c03860
Changes
2
Hide whitespace changes
Inline
Side-by-side
Distribution/PackageDescription/Parse.hs
View file @
bba80735
...
...
@@ -182,7 +182,7 @@ executableFieldDescrs =
binfoFieldDescrs
::
[
FieldDescr
BuildInfo
]
binfoFieldDescrs
=
[
simpleField
"buildable"
(
text
.
show
)
parse
ReadS
(
text
.
show
)
parse
Bool
buildable
(
\
val
binfo
->
binfo
{
buildable
=
val
})
,
commaListField
"build-tools"
showDependency
parseBuildTool
...
...
@@ -253,7 +253,7 @@ flagFieldDescrs =
showFreeText
(
munch
(
const
True
))
flagDescription
(
\
val
fl
->
fl
{
flagDescription
=
val
})
,
simpleField
"default"
(
text
.
show
)
parse
ReadS
(
text
.
show
)
parse
Bool
flagDefault
(
\
val
fl
->
fl
{
flagDefault
=
val
})
]
...
...
Distribution/ParseUtils.hs
View file @
bba80735
...
...
@@ -59,7 +59,7 @@ module Distribution.ParseUtils (
parseSepList
,
parseCommaList
,
parseOptCommaList
,
showFilePath
,
showToken
,
showTestedWith
,
showDependency
,
showFreeText
,
field
,
simpleField
,
listField
,
commaListField
,
optsField
,
liftField
,
parseReadS
,
parseReadSQ
,
parseQuoted
,
parseReadS
,
parseReadSQ
,
parseQuoted
,
parseBool
)
where
import
Distribution.Compiler
(
CompilerFlavor
)
...
...
@@ -477,6 +477,10 @@ parseFilePathQ = parseTokenQ
parseReadS
::
Read
a
=>
ReadP
r
a
parseReadS
=
readS_to_P
reads
parseBool
::
ReadP
r
Bool
parseBool
=
choice
[
(
string
"true"
<++
string
"True"
)
>>
return
True
,
(
string
"false"
<++
string
"False"
)
>>
return
False
]
parseBuildTool
::
ReadP
r
Dependency
parseBuildTool
=
do
name
<-
parseBuildToolNameQ
skipSpaces
...
...
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