[commit: ghc] master: Use Test.Regex.PCRE instead of .Posix in compare (5943a5b)
Ian Lynagh
igloo at earth.li
Sun Jan 27 17:49:02 CET 2013
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/5943a5b2cf7d5da2d253dec73ee5be6ce870e4ba
>---------------------------------------------------------------
commit 5943a5b2cf7d5da2d253dec73ee5be6ce870e4ba
Author: Ian Lynagh <ian at well-typed.com>
Date: Sun Jan 27 16:18:06 2013 +0000
Use Test.Regex.PCRE instead of .Posix in compare
This program:
main :: IO ()
main = do re "[^ ]" "\207"
re "[ ]" "\207"
re " " "\207"
re :: String -> String -> IO ()
re r str = let r' = makeRegex r :: Regex
res = matchM r' str :: Maybe (String, String, String, [String])
in print res
prints
Nothing
Nothing
Nothing
for me with Posix, but
Just ("","\207","",[])
Nothing
Nothing
with PCRE. This was causing compare to fail with
Tar line doesn't parse: "drwxrwxr-x simonmar/GHC 0 2012-12-08 21:35 ghc-7.6.1.20121207/libraries/haskeline/tests/dummy-\206\188\206\177\207\\302\\203/"
on the GHC source tarball.
>---------------------------------------------------------------
distrib/compare/Utils.hs | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/distrib/compare/Utils.hs b/distrib/compare/Utils.hs
index e2da6b5..720f533 100644
--- a/distrib/compare/Utils.hs
+++ b/distrib/compare/Utils.hs
@@ -5,7 +5,7 @@ import Data.Function
import Data.List
import System.Exit
import System.IO
-import Text.Regex.Posix
+import Text.Regex.PCRE
die :: Errors -> IO a
die errs = do mapM_ (hPutStrLn stderr) errs
More information about the ghc-commits
mailing list