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
e4df724b
Commit
e4df724b
authored
Oct 08, 2007
by
Simon Marlow
Browse files
FIX #1748: -main-is wasn't handling the case of a single hierarchical module
test case is driver062.5
parent
a6e73f94
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/main/DynFlags.hs
View file @
e4df724b
...
...
@@ -91,7 +91,7 @@ import Data.List ( isPrefixOf )
import
Util
(
split
)
#
endif
import
Data.Char
(
isUpper
)
import
Data.Char
import
System.IO
(
hPutStrLn
,
stderr
)
-- -----------------------------------------------------------------------------
...
...
@@ -1445,15 +1445,16 @@ setOptLevel n dflags
setMainIs
::
String
->
DynP
()
setMainIs
arg
|
not
(
null
main_fn
)
-- The arg looked like "Foo.baz"
|
not
(
null
main_fn
)
&&
isLower
(
head
main_fn
)
-- The arg looked like "Foo.Bar.baz"
=
upd
$
\
d
->
d
{
mainFunIs
=
Just
main_fn
,
mainModIs
=
mkModule
mainPackageId
(
mkModuleName
main_mod
)
}
mainModIs
=
mkModule
mainPackageId
(
mkModuleName
main_mod
)
}
|
isUpper
(
head
main_mod
)
-- The arg looked like "Foo"
=
upd
$
\
d
->
d
{
mainModIs
=
mkModule
mainPackageId
(
mkModuleName
main_mod
)
}
|
isUpper
(
head
arg
)
-- The arg looked like "Foo"
or "Foo.Bar"
=
upd
$
\
d
->
d
{
mainModIs
=
mkModule
mainPackageId
(
mkModuleName
arg
)
}
|
otherwise
-- The arg looked like "baz"
=
upd
$
\
d
->
d
{
mainFunIs
=
Just
main_mod
}
=
upd
$
\
d
->
d
{
mainFunIs
=
Just
arg
}
where
(
main_mod
,
main_fn
)
=
splitLongestPrefix
arg
(
==
'.'
)
...
...
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