Commit c18b525a authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski

Remove dead code for commandline parsing

Summary:
PrefixPred and AnySuffixPred are not used
since static flags were removed in bbd3c399.

Test Plan: validate

Reviewers: bgamari, tdammers

Reviewed By: tdammers

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5111
parent 2cf98e22
......@@ -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
--
......
......@@ -2698,11 +2698,8 @@ allNonDeprecatedFlags = allFlagsDeps False
allFlagsDeps :: Bool -> [String]
allFlagsDeps keepDeprecated = [ '-':flagName flag
| (deprecated, flag) <- flagsAllDeps
, ok (flagOptKind flag)
, keepDeprecated || not (isDeprecated deprecated)]
where ok (PrefixPred _ _) = False
ok _ = True
isDeprecated Deprecated = True
where isDeprecated Deprecated = True
isDeprecated _ = False
{-
......@@ -2762,10 +2759,6 @@ add_dep_message (PassFlag f) message =
PassFlag $ \s -> f s >> deprecate message
add_dep_message (AnySuffix f) message =
AnySuffix $ \s -> f s >> deprecate message
add_dep_message (PrefixPred pred f) message =
PrefixPred pred $ \s -> f s >> deprecate message
add_dep_message (AnySuffixPred pred f) message =
AnySuffixPred pred $ \s -> f s >> deprecate message
----------------------- The main flags themselves ------------------------------
-- See Note [Updating flag description in the User's Guide]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment