Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-7.4
http://hackage.haskell.org/trac/ghc/changeset/00ae9a91b82de53a22bd55fe026f42842a3713a0
>---------------------------------------------------------------
commit 00ae9a91b82de53a22bd55fe026f42842a3713a0
Author: Simon Marlow <marlowsd at gmail.com>
Date: Tue Mar 13 11:30:13 2012 +0000
Tweak to flag parsing (#5921)
-o2/Main.exe should be an invalid flag, not a linker input
MERGED from commit 93299cce9a4f7bc65b8164f779a37ef7f9f7c4a0
>---------------------------------------------------------------
ghc/Main.hs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 4829a4f..f7bff59 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -260,6 +260,10 @@ partition_args (arg:args) srcs objs
- module names (not forgetting hierarchical module names),
+ - things beginning with '-' are flags that were not recognised by
+ the flag parser, and we want them to generate errors later in
+ checkOptions, so we class them as source files (#5921)
+
- and finally we consider everything not containing a '.' to be
a comp manager input, as shorthand for a .hs or .lhs filename.
@@ -268,8 +272,9 @@ partition_args (arg:args) srcs objs
-}
looks_like_an_input :: String -> Bool
looks_like_an_input m = isSourceFilename m
- || looksLikeModuleName m
- || '.' `notElem` m
+ || looksLikeModuleName m
+ || "-" `isPrefixOf` m
+ || '.' `notElem` m
-- -----------------------------------------------------------------------------
-- Option sanity checks