regex-pcre 0.93 → 0.94
raw patch · 7 files changed
+70/−42 lines, 7 filesdep +arraydep +bytestringdep +containersdep ~basedep ~regex-base
Dependencies added: array, bytestring, containers
Dependency ranges changed: base, regex-base
Files
- Text/Regex/PCRE.hs +1/−1
- Text/Regex/PCRE/ByteString.hs +5/−1
- Text/Regex/PCRE/ByteString/Lazy.hs +5/−1
- Text/Regex/PCRE/Sequence.hs +11/−7
- Text/Regex/PCRE/String.hs +1/−1
- Text/Regex/PCRE/Wrap.hsc +2/−1
- regex-pcre.cabal +45/−30
Text/Regex/PCRE.hs view
@@ -65,6 +65,6 @@ getVersion_Text_Regex_PCRE :: Version getVersion_Text_Regex_PCRE =- Version { versionBranch = [0,93]+ Version { versionBranch = [0,94] -- Keep in sync with regex-pcre.cabal , versionTags = ["unstable"] }
Text/Regex/PCRE/ByteString.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -fglasgow-exts -fno-warn-orphans #-}+{-# OPTIONS_GHC -fno-warn-orphans #-} {-| This exports instances of the high level API and the medium level API of 'compile','execute', and 'regexec'.@@ -49,7 +49,11 @@ import Data.Array(Array,listArray) import Data.ByteString(ByteString) import qualified Data.ByteString as B(empty,useAsCString,last,take,drop,null,pack)+#ifdef SPLIT_BASE+import qualified Data.ByteString.Unsafe as B(unsafeUseAsCString,unsafeUseAsCStringLen)+#else import qualified Data.ByteString.Base as B(unsafeUseAsCString,unsafeUseAsCStringLen)+#endif import System.IO.Unsafe(unsafePerformIO) import Text.Regex.Base.RegexLike(RegexContext(..),RegexMaker(..),RegexLike(..),MatchOffset,MatchLength) import Text.Regex.Base.Impl(polymatch,polymatchM)
Text/Regex/PCRE/ByteString/Lazy.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -fglasgow-exts -fno-warn-orphans #-}+{-# OPTIONS_GHC -fno-warn-orphans #-} {-| This exports instances of the high level API and the medium level API of 'compile','execute', and 'regexec'.@@ -49,7 +49,11 @@ import Data.Array(Array) import qualified Data.ByteString.Lazy as L(ByteString,toChunks,fromChunks,last,null,snoc) import qualified Data.ByteString as B(ByteString,concat,pack)+#ifdef SPLIT_BASE+import qualified Data.ByteString.Unsafe as B(unsafeUseAsCString,unsafeUseAsCStringLen)+#else import qualified Data.ByteString.Base as B(unsafeUseAsCString,unsafeUseAsCStringLen)+#endif import System.IO.Unsafe(unsafePerformIO) import Text.Regex.Base.RegexLike(RegexContext(..),RegexMaker(..),RegexLike(..),MatchOffset,MatchLength) import Text.Regex.Base.Impl(polymatch,polymatchM)
Text/Regex/PCRE/Sequence.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -fglasgow-exts -fno-warn-orphans -fbang-patterns #-}+{-# OPTIONS_GHC -fno-warn-orphans #-} {-| This exports instances of the high level API and the medium level API of 'compile','execute', and 'regexec'.@@ -132,9 +132,11 @@ withSeq s f = let -- Ensure null at end of s len = S.length s- pokes !p !a = case viewl a of- EmptyL -> return ()- c :< a' -> poke p (castCharToCChar c) >> pokes (advancePtr p 1) a'+ pokes p a | seq p (seq a False) = undefined+ | otherwise =+ case viewl a of+ EmptyL -> return ()+ c :< a' -> poke p (castCharToCChar c) >> pokes (advancePtr p 1) a' in allocaBytes (S.length s) (\ptr -> pokes ptr s >> f (ptr,len)) withSeq0 :: Seq Char -> (CString -> IO a) -> IO a@@ -144,7 +146,9 @@ EmptyR -> singleton '\0' _ :> '\0' -> s _ -> s |> '\0'- pokes p a = case viewl a of -- bang pokes !p !a- EmptyL -> return ()- c :< a' -> poke p (castCharToCChar c) >> pokes (advancePtr p 1) a'+ pokes p a | seq p (seq a False) = undefined+ | otherwise =+ case viewl a of -- bang pokes !p !a+ EmptyL -> return ()+ c :< a' -> poke p (castCharToCChar c) >> pokes (advancePtr p 1) a' in allocaBytes (S.length s') (\ptr -> pokes ptr s' >> f ptr)
Text/Regex/PCRE/String.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS_GHC -fglasgow-exts -fno-warn-orphans #-}+{-# OPTIONS_GHC -fno-warn-orphans #-} {-| This exports instances of the high level API and the medium level API of 'compile','execute', and 'regexec'.
Text/Regex/PCRE/Wrap.hsc view
@@ -1,11 +1,12 @@-{-# OPTIONS_GHC -fglasgow-exts -fffi #-} -- The exported symbols are the same whether HAVE_PCRE_H is defined, -- but when if it is not defined then 'getVersion == Nothing' and all -- other exported values will call error or fail. -- | This will fail or error only if allocation fails or a nullPtr is passed in.+ -- TODO :: Consider wrapMatchAll using list of start/end offsets and not MatchArray --+ {- Copyright : (c) Chris Kuklewicz 2007 -} module Text.Regex.PCRE.Wrap( -- ** High-level interface
regex-pcre.cabal view
@@ -1,6 +1,7 @@ Name: regex-pcre-Version: 0.93--- Cabal-Version: >=1.1.4+-- Keep the Version below in sync with ./Text/Regex/PCRE.hs value getVersion_Text_Regex_PCRE :: Version+Version: 0.94+Cabal-Version: >=1.2 License: BSD3 License-File: LICENSE Copyright: Copyright (c) 2006, Christopher Kuklewicz@@ -13,31 +14,45 @@ Description: The PCRE backend to accompany regex-base, see www.pcre.org Category: Text Tested-With: GHC-Build-Depends: base >= 2.0, regex-base >= 0.80--- Data-Files:--- Extra-Source-Files:--- Extra-Tmp-Files:-Exposed-Modules: Text.Regex.PCRE- Text.Regex.PCRE.Wrap- Text.Regex.PCRE.String- Text.Regex.PCRE.Sequence- Text.Regex.PCRE.ByteString- Text.Regex.PCRE.ByteString.Lazy-Buildable: True--- Other-Modules:--- HS-Source-Dirs: "."-Extensions: MultiParamTypeClasses, FunctionalDependencies--- GHC-Options: -Wall -Werror-GHC-Options: -Wall -Werror -O2--- GHC-Options: -Wall -ddump-minimal-imports--- GHC-Prof-Options:--- Hugs-Options:--- NHC-Options:--- C-Sources:--- Includes:--- LD-Options:--- Frameworks:-CC-Options: -DHAVE_PCRE_H-Extra-Libraries: pcre---Include-Dirs: /opt/local/include---Extra-Lib-Dirs: /opt/local/lib+flag splitBase+ description: Choose the new smaller, split-up base package.+library+ if flag(splitBase)+ Build-Depends: base >= 3.0, regex-base >= 0.93, array, containers, bytestring+ -- Need the next symbol for using CPP to get Data.ByteString.Base|Unsafe in+ -- ./Text/Regex/Posix/ByteString.hs and ./Text/Regex/Posix/ByteString/Lazy.hs+ CPP-Options: "-DSPLIT_BASE=1"+ else+ build-depends: base < 3.0, regex-base >= 0.93+ -- Data-Files:+ -- Extra-Source-Files:+ -- Extra-Tmp-Files:+ Exposed-Modules: Text.Regex.PCRE+ Text.Regex.PCRE.Wrap+ Text.Regex.PCRE.String+ Text.Regex.PCRE.Sequence+ Text.Regex.PCRE.ByteString+ Text.Regex.PCRE.ByteString.Lazy+ Buildable: True+ -- Other-Modules:+ -- HS-Source-Dirs: "."+ -- The CPP is for using -DSPLIT_BASE=1 to get Data.ByteString.Base|Unsafe+ -- And the CPP is for using -DHAVE_PCRE_H to get the local posix library+ Extensions: MultiParamTypeClasses, FunctionalDependencies, CPP+ -- GHC-Options: -Wall -Werror -O2+ GHC-Options: -Wall -O2+ -- GHC-Options: -Wall -ddump-minimal-imports+ -- GHC-Prof-Options:+ -- Hugs-Options:+ -- NHC-Options:+ -- C-Sources:+ -- Includes:+ -- LD-Options:+ -- Frameworks:+ -- The only reason to NOT define -DHAVE_PCRE_H is if you are on+ -- a plotform without a regex library but want to compile this package+ -- anyway. The resulting regex-posix will exist, but throw errors.+ CC-Options: -DHAVE_PCRE_H+ Extra-Libraries: pcre+ --Include-Dirs: /opt/local/include+ --Extra-Lib-Dirs: /opt/local/lib