regex-pderiv 0.1.3 → 0.1.4
raw patch · 8 files changed
+21/−6 lines, 8 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Text.Regex.PDeriv.Dictionary: Trie :: ![a] -> !IntMap (Trie a) -> Trie a
+ Text.Regex.PDeriv.Dictionary: Trie :: ![a] -> !(IntMap (Trie a)) -> Trie a
Files
- Text/Regex/PDeriv/ByteString/LeftToRight.lhs +2/−0
- Text/Regex/PDeriv/ByteString/LeftToRightD.lhs +7/−2
- Text/Regex/PDeriv/ByteString/Posix.lhs +1/−0
- Text/Regex/PDeriv/ByteString/RightToLeft.lhs +2/−0
- Text/Regex/PDeriv/ByteString/TwoPasses.lhs +2/−0
- Text/Regex/PDeriv/RE.lhs +4/−3
- Text/Regex/PDeriv/String/LeftToRightD.lhs +2/−0
- regex-pderiv.cabal +1/−1
Text/Regex/PDeriv/ByteString/LeftToRight.lhs view
@@ -20,6 +20,8 @@ > , regexec > ) where ++> import Prelude hiding (Word) > import Data.List > import Data.Char (ord) > -- import GHC.Int
Text/Regex/PDeriv/ByteString/LeftToRightD.lhs view
@@ -20,6 +20,7 @@ > , regexec > ) where +> import Prelude hiding (Word) > import Data.List > import Data.Char (ord) > -- import GHC.Int@@ -98,11 +99,12 @@ > mapping :: D.Dictionary (Pat,Int) -> Pat -> Int > mapping dictionary x = let candidates = D.lookupAll (D.hash x) dictionary-> in candidates `seq` +> io = unsafePerformIO ((print x) >> (print (length candidates)))+> in candidates `seq` -- io `seq` > case candidates of > [(_,i)] -> i > _ -> -> case lookup x candidates of+> case {-# SCC "mapping_lookup" #-} lookup x candidates of > (Just i) -> i > Nothing -> error ("this should not happen. looking up " ++ (pretty x) ++ " from " ++ (show candidates) ) @@ -134,6 +136,9 @@ This would cause some compile time overhead and trading space with time. Technical problem, how to hash a [ Int ] in Haskell?+++todo clean up buildDPat0Table merge it with buildPdPat0Table > type NFAStates = [ Int ]
Text/Regex/PDeriv/ByteString/Posix.lhs view
@@ -27,6 +27,7 @@ > ) where +> import Prelude hiding (Word) > import System.IO.Unsafe
Text/Regex/PDeriv/ByteString/RightToLeft.lhs view
@@ -22,6 +22,8 @@ > , parsePat > ) where ++> import Prelude hiding (Word) > import Data.List > import Data.Char (ord) > import GHC.Int
Text/Regex/PDeriv/ByteString/TwoPasses.lhs view
@@ -23,6 +23,8 @@ > , regexec > ) where ++> import Prelude hiding (Word) > import Data.List > import Data.Char (ord) > import GHC.Int
Text/Regex/PDeriv/RE.lhs view
@@ -66,9 +66,9 @@ > hash (Choice r1 r2 NotGreedy) = {- let x1 = head (hash r1) > x2 = head (hash r2) > in [ 4 + x1 * primeL + x2 * primeR ] -} [4]-> hash (Seq r1 r2) = {- let x1 = head (hash r1)+> hash (Seq r1 r2) = let x1 = head (hash r1) > x2 = head (hash r2)-> in [ 5 + x1 * primeL + x2 * primeR ] -} [5]+> in [ 5 + x1 * primeL + x2 * primeR ] -- [5] > hash (Star r Greedy) = {- let x = head (hash r) > in [ 6 + x * primeL ] -} [6] > hash (Star r NotGreedy) = {- let x = head (hash r)@@ -121,7 +121,8 @@ > -- | function 'partDeriv' implements the partial derivative operations for regular expressions. We don't pay attention to the greediness flag here. > partDeriv :: RE -> Char -> [RE]-> partDeriv r l = nub (partDerivSub r l)+> partDeriv r l = let pds = (partDerivSub r l)+> in {-# SCC "nub_pd" #-} nub pds > partDerivSub Phi l = []
Text/Regex/PDeriv/String/LeftToRightD.lhs view
@@ -20,6 +20,8 @@ > , regexec > ) where ++> import Prelude hiding (Word) > import Data.List > import Data.Char (ord) > -- import GHC.Int
regex-pderiv.cabal view
@@ -1,5 +1,5 @@ Name: regex-pderiv-Version: 0.1.3+Version: 0.1.4 License: BSD3 License-File: LICENSE Copyright: Copyright (c) 2010-2012, Kenny Zhuo Ming Lu and Martin Sulzmann