diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-01-26 08:52:34 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-01-26 08:52:34 -0400 |
commit | e4cd36ba9b3af5fd877f75d04aaf428163cd8acd (patch) | |
tree | 0803232897be00ebc40b0e99b675f69ec37f45c6 /Utility | |
parent | 24590d731eba893cf11ce5651af6c47cb6f8d93f (diff) |
remove TDFA build flag
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Glob.hs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/Utility/Glob.hs b/Utility/Glob.hs index 91b577f53..98ffe751b 100644 --- a/Utility/Glob.hs +++ b/Utility/Glob.hs @@ -1,15 +1,10 @@ {- file globbing - - - This uses TDFA when available, with a fallback to regex-compat. - - TDFA is less buggy in its support for non-unicode characters. - - - Copyright 2014 Joey Hess <id@joeyh.name> - - License: BSD-2-clause -} -{-# LANGUAGE CPP #-} - module Utility.Glob ( Glob, GlobCase(..), @@ -19,13 +14,8 @@ module Utility.Glob ( import System.Path.WildMatch -#ifdef WITH_TDFA import "regex-tdfa" Text.Regex.TDFA import "regex-tdfa" Text.Regex.TDFA.String -#else -import Text.Regex -import Data.Maybe -#endif newtype Glob = Glob Regex @@ -34,13 +24,9 @@ data GlobCase = CaseSensative | CaseInsensative {- Compiles a glob to a regex, that can be repeatedly used. -} compileGlob :: String -> GlobCase -> Glob compileGlob glob globcase = Glob $ -#ifdef WITH_TDFA case compile (defaultCompOpt {caseSensitive = casesentitive}) defaultExecOpt regex of Right r -> r Left _ -> error $ "failed to compile regex: " ++ regex -#else - mkRegexWithOpts regex casesentitive True -#endif where regex = '^':wildToRegex glob casesentitive = case globcase of @@ -49,10 +35,6 @@ compileGlob glob globcase = Glob $ matchGlob :: Glob -> String -> Bool matchGlob (Glob regex) val = -#ifdef WITH_TDFA case execute regex val of Right (Just _) -> True _ -> False -#else - isJust $ matchRegex regex val -#endif |