summaryrefslogtreecommitdiff
path: root/compiler/main/CmdLineParser.hs
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-08-28 12:52:47 +0200
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-08-28 12:52:47 +0200
commitc18b525a6f226187a12ed907fa5d3b200daab914 (patch)
tree2e0b6470dfc6159aaca78a9162762045f737baf8 /compiler/main/CmdLineParser.hs
parent2cf98e2207421200fc73c25a08f6435859cdff92 (diff)
downloadhaskell-c18b525a6f226187a12ed907fa5d3b200daab914.tar.gz
Remove dead code for commandline parsing
Summary: PrefixPred and AnySuffixPred are not used since static flags were removed in bbd3c399939. Test Plan: validate Reviewers: bgamari, tdammers Reviewed By: tdammers Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5111
Diffstat (limited to 'compiler/main/CmdLineParser.hs')
-rw-r--r--compiler/main/CmdLineParser.hs8
1 files changed, 0 insertions, 8 deletions
diff --git a/compiler/main/CmdLineParser.hs b/compiler/main/CmdLineParser.hs
index c876f58f64..cb30b6fe6c 100644
--- a/compiler/main/CmdLineParser.hs
+++ b/compiler/main/CmdLineParser.hs
@@ -79,8 +79,6 @@ data OptKind m -- Suppose the flag is -f
| FloatSuffix (Float -> EwM m ()) -- -f or -f=n; pass n to fn
| PassFlag (String -> EwM m ()) -- -f; pass "-f" fn
| AnySuffix (String -> EwM m ()) -- -f or -farg; pass entire "-farg" to fn
- | PrefixPred (String -> Bool) (String -> EwM m ())
- | AnySuffixPred (String -> Bool) (String -> EwM m ())
--------------------------------------------------------
@@ -246,9 +244,6 @@ processOneArg opt_kind rest arg args
Prefix f | notNull rest_no_eq -> Right (f rest_no_eq, args)
| otherwise -> missingArgErr dash_arg
- PrefixPred _ f | notNull rest_no_eq -> Right (f rest_no_eq, args)
- | otherwise -> unknownFlagErr dash_arg
-
PassFlag f | notNull rest -> unknownFlagErr dash_arg
| otherwise -> Right (f dash_arg, args)
@@ -264,7 +259,6 @@ processOneArg opt_kind rest arg args
OptPrefix f -> Right (f rest_no_eq, args)
AnySuffix f -> Right (f dash_arg, args)
- AnySuffixPred _ f -> Right (f dash_arg, args)
findArg :: [Flag m] -> String -> Maybe (String, OptKind m)
findArg spec arg =
@@ -284,14 +278,12 @@ arg_ok (HasArg _) _ _ = True
arg_ok (SepArg _) rest _ = null rest
arg_ok (Prefix _) _ _ = True -- Missing argument checked for in processOneArg t
-- to improve error message (Trac #12625)
-arg_ok (PrefixPred p _) rest _ = notNull rest && p (dropEq rest)
arg_ok (OptIntSuffix _) _ _ = True
arg_ok (IntSuffix _) _ _ = True
arg_ok (FloatSuffix _) _ _ = True
arg_ok (OptPrefix _) _ _ = True
arg_ok (PassFlag _) rest _ = null rest
arg_ok (AnySuffix _) _ _ = True
-arg_ok (AnySuffixPred p _) _ arg = p arg
-- | Parse an Int
--