diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-02-03 13:23:34 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-02-03 13:23:34 -0400 |
commit | 01c701b5a5c18cfa952394ae1cbd2249cfd08f51 (patch) | |
tree | 8ca806e20912726ff1d2df7d3271a86426603d48 /Annex | |
parent | af197c7fc387794d3a558b4f8f23ebd9d5554aa0 (diff) |
simplify
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/FileMatcher.hs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Annex/FileMatcher.hs b/Annex/FileMatcher.hs index 641fe49c9..e3482ec8b 100644 --- a/Annex/FileMatcher.hs +++ b/Annex/FileMatcher.hs @@ -71,33 +71,33 @@ exprParser matchstandard matchgroupwanted getgroupmap configmap mu expr = preferreddir = fromMaybe "public" $ M.lookup "preferreddir" =<< (`M.lookup` configmap) =<< mu -parseToken :: FileMatcher Annex -> FileMatcher Annex -> MkLimit Annex -> MkLimit Annex -> Annex GroupMap -> String -> Either String (Token (MatchFiles Annex)) +parseToken :: FileMatcher Annex -> FileMatcher Annex -> MatchFiles Annex -> MatchFiles Annex -> Annex GroupMap -> String -> Either String (Token (MatchFiles Annex)) parseToken matchstandard matchgroupwanted checkpresent checkpreferreddir getgroupmap t | t `elem` tokens = Right $ token t | otherwise = case t of "standard" -> call matchstandard "groupwanted" -> call matchgroupwanted - "present" -> use checkpresent - "inpreferreddir" -> use checkpreferreddir + "present" -> simply checkpresent + "inpreferreddir" -> simply checkpreferreddir "unused" -> simply limitUnused "anything" -> simply limitAnything "nothing" -> simply limitNothing _ -> case k of - "include" -> use limitInclude - "exclude" -> use limitExclude - "copies" -> use limitCopies - "lackingcopies" -> use $ limitLackingCopies False - "approxlackingcopies" -> use $ limitLackingCopies True - "inbackend" -> use limitInBackend - "largerthan" -> use $ limitSize (>) - "smallerthan" -> use $ limitSize (<) - "metadata" -> use limitMetaData - "inallgroup" -> use $ limitInAllGroup getgroupmap + "include" -> usev limitInclude + "exclude" -> usev limitExclude + "copies" -> usev limitCopies + "lackingcopies" -> usev $ limitLackingCopies False + "approxlackingcopies" -> usev $ limitLackingCopies True + "inbackend" -> usev limitInBackend + "largerthan" -> usev $ limitSize (>) + "smallerthan" -> usev $ limitSize (<) + "metadata" -> usev limitMetaData + "inallgroup" -> usev $ limitInAllGroup getgroupmap _ -> Left $ "near " ++ show t where (k, v) = separate (== '=') t simply = Right . Operation - use a = Operation <$> a v + usev a = Operation <$> a v call sub = Right $ Operation $ \notpresent mi -> matchMrun sub $ \a -> a notpresent mi |