Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
60a049fa
Commit
60a049fa
authored
Jun 20, 2007
by
simonpj@microsoft.com
Browse files
Wibbles in flaggery, concerning backward compatibility with -f flags
parent
970d5b88
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/main/DynFlags.hs
View file @
60a049fa
...
...
@@ -1025,7 +1025,7 @@ dynamic_flags = [
,
(
"f"
,
PrefixPred
(
isNoFlag
fFlags
)
(
\
f
->
unSetDynFlag
(
getNoFlag
fFlags
f
))
)
-- For now, allow -X flags with -f; ToDo: report this as deprecated
,
(
"f"
,
PrefixPred
(
isFlag
xFlags
)
(
\
f
->
setDynFlag
(
getFlag
f
Flags
f
))
)
,
(
"f"
,
PrefixPred
(
isFlag
xFlags
)
(
\
f
->
setDynFlag
(
getFlag
x
Flags
f
))
)
-- the rest of the -X* and -Xno-* flags
,
(
"X"
,
PrefixPred
(
isFlag
xFlags
)
(
\
f
->
setDynFlag
(
getFlag
xFlags
f
))
)
...
...
@@ -1138,10 +1138,12 @@ getFlag, getNoFlag :: [(String,a)] -> String -> a
getFlag
flags
f
=
get_flag
flags
(
normaliseFlag
f
)
getNoFlag
flags
f
=
get
F
lag
flags
(
fromJust
(
noFlag_maybe
(
normaliseFlag
f
)))
getNoFlag
flags
f
=
get
_f
lag
flags
(
fromJust
(
noFlag_maybe
(
normaliseFlag
f
)))
-- The flag should be a no-flag already
get_flag
flags
nf
=
head
[
opt
|
(
ff
,
opt
)
<-
flags
,
normaliseFlag
ff
==
nf
]
get_flag
flags
nf
=
case
[
opt
|
(
ff
,
opt
)
<-
flags
,
normaliseFlag
ff
==
nf
]
of
(
o
:
os
)
->
o
[]
->
panic
(
"get_flag "
++
nf
)
------------------
noFlag_maybe
::
String
->
Maybe
String
...
...
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