regex-pderiv 0.1.4 → 0.2.0
raw patch · 9 files changed
+445/−10 lines, 9 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Text.Regex.PDeriv.ByteString: captureGroups :: ExecOption -> Bool
- Text.Regex.PDeriv.ByteString: caseSensitive :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString: lastStarGreedy :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString: multiline :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString: newSyntax :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString: rightAssoc :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRight: captureGroups :: ExecOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRight: caseSensitive :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRight: instance Read CompOption
- Text.Regex.PDeriv.ByteString.LeftToRight: instance Read ExecOption
- Text.Regex.PDeriv.ByteString.LeftToRight: instance RegexOptions Regex CompOption ExecOption
- Text.Regex.PDeriv.ByteString.LeftToRight: instance Show CompOption
- Text.Regex.PDeriv.ByteString.LeftToRight: instance Show ExecOption
- Text.Regex.PDeriv.ByteString.LeftToRight: lastStarGreedy :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRight: multiline :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRight: newSyntax :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRight: rightAssoc :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRightD: captureGroups :: ExecOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRightD: caseSensitive :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRightD: instance Read CompOption
- Text.Regex.PDeriv.ByteString.LeftToRightD: instance Read ExecOption
- Text.Regex.PDeriv.ByteString.LeftToRightD: instance RegexOptions Regex CompOption ExecOption
- Text.Regex.PDeriv.ByteString.LeftToRightD: instance Show CompOption
- Text.Regex.PDeriv.ByteString.LeftToRightD: instance Show ExecOption
- Text.Regex.PDeriv.ByteString.LeftToRightD: lastStarGreedy :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRightD: multiline :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRightD: newSyntax :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.LeftToRightD: rightAssoc :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.Posix: captureGroups :: ExecOption -> Bool
- Text.Regex.PDeriv.ByteString.Posix: caseSensitive :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.Posix: instance Read CompOption
- Text.Regex.PDeriv.ByteString.Posix: instance Read ExecOption
- Text.Regex.PDeriv.ByteString.Posix: instance RegexLike Regex ByteString
- Text.Regex.PDeriv.ByteString.Posix: instance RegexOptions Regex CompOption ExecOption
- Text.Regex.PDeriv.ByteString.Posix: instance Show CompOption
- Text.Regex.PDeriv.ByteString.Posix: instance Show ExecOption
- Text.Regex.PDeriv.ByteString.Posix: lastStarGreedy :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.Posix: multiline :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.Posix: newSyntax :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.Posix: rightAssoc :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.RightToLeft: captureGroups :: ExecOption -> Bool
- Text.Regex.PDeriv.ByteString.RightToLeft: caseSensitive :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.RightToLeft: instance Read CompOption
- Text.Regex.PDeriv.ByteString.RightToLeft: instance Read ExecOption
- Text.Regex.PDeriv.ByteString.RightToLeft: instance RegexOptions Regex CompOption ExecOption
- Text.Regex.PDeriv.ByteString.RightToLeft: instance Show CompOption
- Text.Regex.PDeriv.ByteString.RightToLeft: instance Show ExecOption
- Text.Regex.PDeriv.ByteString.RightToLeft: lastStarGreedy :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.RightToLeft: multiline :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.RightToLeft: newSyntax :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.RightToLeft: rightAssoc :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.TwoPasses: captureGroups :: ExecOption -> Bool
- Text.Regex.PDeriv.ByteString.TwoPasses: caseSensitive :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.TwoPasses: instance Read CompOption
- Text.Regex.PDeriv.ByteString.TwoPasses: instance Read ExecOption
- Text.Regex.PDeriv.ByteString.TwoPasses: instance RegexOptions Regex CompOption ExecOption
- Text.Regex.PDeriv.ByteString.TwoPasses: instance Show CompOption
- Text.Regex.PDeriv.ByteString.TwoPasses: instance Show ExecOption
- Text.Regex.PDeriv.ByteString.TwoPasses: lastStarGreedy :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.TwoPasses: multiline :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.TwoPasses: newSyntax :: CompOption -> Bool
- Text.Regex.PDeriv.ByteString.TwoPasses: rightAssoc :: CompOption -> Bool
- Text.Regex.PDeriv.Common: instance Eq GFlag
- Text.Regex.PDeriv.Common: instance Eq Range
- Text.Regex.PDeriv.Common: instance Show GFlag
- Text.Regex.PDeriv.Common: instance Show Range
- Text.Regex.PDeriv.Dictionary: instance (Key a, Key b) => Key (a, b)
- Text.Regex.PDeriv.Dictionary: instance (Key a, Key b, Key c) => Key (a, b, c)
- Text.Regex.PDeriv.Dictionary: instance Key Char
- Text.Regex.PDeriv.Dictionary: instance Key Int
- Text.Regex.PDeriv.Dictionary: instance Key a => Key [a]
- Text.Regex.PDeriv.ExtPattern: instance Show EPat
- Text.Regex.PDeriv.IntPattern: instance Eq Pat
- Text.Regex.PDeriv.IntPattern: instance IsEpsilon Pat
- Text.Regex.PDeriv.IntPattern: instance IsGreedy Pat
- Text.Regex.PDeriv.IntPattern: instance IsPhi Pat
- Text.Regex.PDeriv.IntPattern: instance Key Pat
- Text.Regex.PDeriv.IntPattern: instance Pretty Pat
- Text.Regex.PDeriv.IntPattern: instance Show Pat
- Text.Regex.PDeriv.IntPattern: instance Simplifiable Pat
- Text.Regex.PDeriv.Nfa: all_states :: NFA s a -> [s]
- Text.Regex.PDeriv.Nfa: delta_states :: NFA s a -> [(s, a, s)]
- Text.Regex.PDeriv.Nfa: final_states :: NFA s a -> [s]
- Text.Regex.PDeriv.Nfa: init_states :: NFA s a -> [s]
- Text.Regex.PDeriv.Nfa: instance (Show s, Show a) => Show (NFA s a)
- Text.Regex.PDeriv.Nfa: instance Show a => Show (SNFA s a)
- Text.Regex.PDeriv.Nfa: mapping_states :: SNFA s a -> s -> Int
- Text.Regex.PDeriv.Nfa: sall_states :: SNFA s a -> [Int]
- Text.Regex.PDeriv.Nfa: sdelta_states :: SNFA s a -> [(Int, a, Int)]
- Text.Regex.PDeriv.Nfa: sfinal_states :: SNFA s a -> [Int]
- Text.Regex.PDeriv.Nfa: sinit_states :: SNFA s a -> [Int]
- Text.Regex.PDeriv.RE: instance Eq RE
- Text.Regex.PDeriv.RE: instance IsEpsilon RE
- Text.Regex.PDeriv.RE: instance IsGreedy RE
- Text.Regex.PDeriv.RE: instance IsPhi RE
- Text.Regex.PDeriv.RE: instance Key RE
- Text.Regex.PDeriv.RE: instance PosEpsilon RE
- Text.Regex.PDeriv.RE: instance Show RE
- Text.Regex.PDeriv.RE: instance Simplifiable RE
- Text.Regex.PDeriv.String: captureGroups :: ExecOption -> Bool
- Text.Regex.PDeriv.String: caseSensitive :: CompOption -> Bool
- Text.Regex.PDeriv.String: lastStarGreedy :: CompOption -> Bool
- Text.Regex.PDeriv.String: multiline :: CompOption -> Bool
- Text.Regex.PDeriv.String: newSyntax :: CompOption -> Bool
- Text.Regex.PDeriv.String: rightAssoc :: CompOption -> Bool
- Text.Regex.PDeriv.String.LeftToRightD: captureGroups :: ExecOption -> Bool
- Text.Regex.PDeriv.String.LeftToRightD: caseSensitive :: CompOption -> Bool
- Text.Regex.PDeriv.String.LeftToRightD: instance Read CompOption
- Text.Regex.PDeriv.String.LeftToRightD: instance Read ExecOption
- Text.Regex.PDeriv.String.LeftToRightD: instance RegexOptions Regex CompOption ExecOption
- Text.Regex.PDeriv.String.LeftToRightD: instance Show CompOption
- Text.Regex.PDeriv.String.LeftToRightD: instance Show ExecOption
- Text.Regex.PDeriv.String.LeftToRightD: lastStarGreedy :: CompOption -> Bool
- Text.Regex.PDeriv.String.LeftToRightD: multiline :: CompOption -> Bool
- Text.Regex.PDeriv.String.LeftToRightD: newSyntax :: CompOption -> Bool
- Text.Regex.PDeriv.String.LeftToRightD: rightAssoc :: CompOption -> Bool
- Text.Regex.PDeriv.Translate: instance Show TState
+ Text.Regex.PDeriv.ByteString: [captureGroups] :: ExecOption -> Bool
+ Text.Regex.PDeriv.ByteString: [caseSensitive] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString: [lastStarGreedy] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString: [multiline] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString: [newSyntax] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString: [rightAssoc] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRight: [captureGroups] :: ExecOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRight: [caseSensitive] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRight: [lastStarGreedy] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRight: [multiline] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRight: [newSyntax] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRight: [rightAssoc] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRight: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.LeftToRight.CompOption
+ Text.Regex.PDeriv.ByteString.LeftToRight: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.LeftToRight.ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRight: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.LeftToRight.CompOption
+ Text.Regex.PDeriv.ByteString.LeftToRight: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.LeftToRight.ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRight: instance Text.Regex.Base.RegexLike.RegexOptions Text.Regex.PDeriv.ByteString.LeftToRight.Regex Text.Regex.PDeriv.ByteString.LeftToRight.CompOption Text.Regex.PDeriv.ByteString.LeftToRight.ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRightD: [captureGroups] :: ExecOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightD: [caseSensitive] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightD: [lastStarGreedy] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightD: [multiline] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightD: [newSyntax] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightD: [rightAssoc] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightD: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.LeftToRightD.CompOption
+ Text.Regex.PDeriv.ByteString.LeftToRightD: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.LeftToRightD.ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRightD: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.LeftToRightD.CompOption
+ Text.Regex.PDeriv.ByteString.LeftToRightD: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.LeftToRightD.ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRightD: instance Text.Regex.Base.RegexLike.RegexOptions Text.Regex.PDeriv.ByteString.LeftToRightD.Regex Text.Regex.PDeriv.ByteString.LeftToRightD.CompOption Text.Regex.PDeriv.ByteString.LeftToRightD.ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: CompOption :: Bool -> Bool -> Bool -> Bool -> Bool -> CompOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: ExecOption :: Bool -> ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: [captureGroups] :: ExecOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightS: [caseSensitive] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightS: [lastStarGreedy] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightS: [multiline] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightS: [newSyntax] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightS: [rightAssoc] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.LeftToRightS: compile :: CompOption -> ExecOption -> ByteString -> Either String Regex
+ Text.Regex.PDeriv.ByteString.LeftToRightS: data CompOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: data ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: data Regex
+ Text.Regex.PDeriv.ByteString.LeftToRightS: defaultCompOpt :: RegexOptions regex compOpt execOpt => compOpt
+ Text.Regex.PDeriv.ByteString.LeftToRightS: defaultExecOpt :: RegexOptions regex compOpt execOpt => execOpt
+ Text.Regex.PDeriv.ByteString.LeftToRightS: execute :: Regex -> ByteString -> Either String (Maybe Env)
+ Text.Regex.PDeriv.ByteString.LeftToRightS: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.LeftToRightS.CompOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.LeftToRightS.ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.LeftToRightS.CompOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.LeftToRightS.ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: instance Text.Regex.Base.RegexLike.RegexOptions Text.Regex.PDeriv.ByteString.LeftToRightS.Regex Text.Regex.PDeriv.ByteString.LeftToRightS.CompOption Text.Regex.PDeriv.ByteString.LeftToRightS.ExecOption
+ Text.Regex.PDeriv.ByteString.LeftToRightS: regexec :: Regex -> ByteString -> Either String (Maybe (ByteString, ByteString, ByteString, [ByteString]))
+ Text.Regex.PDeriv.ByteString.Posix: [captureGroups] :: ExecOption -> Bool
+ Text.Regex.PDeriv.ByteString.Posix: [caseSensitive] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.Posix: [lastStarGreedy] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.Posix: [multiline] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.Posix: [newSyntax] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.Posix: [rightAssoc] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.Posix: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.Posix.CompOption
+ Text.Regex.PDeriv.ByteString.Posix: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.Posix.ExecOption
+ Text.Regex.PDeriv.ByteString.Posix: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.Posix.CompOption
+ Text.Regex.PDeriv.ByteString.Posix: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.Posix.ExecOption
+ Text.Regex.PDeriv.ByteString.Posix: instance Text.Regex.Base.RegexLike.RegexLike Text.Regex.PDeriv.ByteString.Posix.Regex Data.ByteString.Internal.ByteString
+ Text.Regex.PDeriv.ByteString.Posix: instance Text.Regex.Base.RegexLike.RegexOptions Text.Regex.PDeriv.ByteString.Posix.Regex Text.Regex.PDeriv.ByteString.Posix.CompOption Text.Regex.PDeriv.ByteString.Posix.ExecOption
+ Text.Regex.PDeriv.ByteString.RightToLeft: [captureGroups] :: ExecOption -> Bool
+ Text.Regex.PDeriv.ByteString.RightToLeft: [caseSensitive] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.RightToLeft: [lastStarGreedy] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.RightToLeft: [multiline] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.RightToLeft: [newSyntax] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.RightToLeft: [rightAssoc] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.RightToLeft: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.RightToLeft.CompOption
+ Text.Regex.PDeriv.ByteString.RightToLeft: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.RightToLeft.ExecOption
+ Text.Regex.PDeriv.ByteString.RightToLeft: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.RightToLeft.CompOption
+ Text.Regex.PDeriv.ByteString.RightToLeft: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.RightToLeft.ExecOption
+ Text.Regex.PDeriv.ByteString.RightToLeft: instance Text.Regex.Base.RegexLike.RegexOptions Text.Regex.PDeriv.ByteString.RightToLeft.Regex Text.Regex.PDeriv.ByteString.RightToLeft.CompOption Text.Regex.PDeriv.ByteString.RightToLeft.ExecOption
+ Text.Regex.PDeriv.ByteString.TwoPasses: [captureGroups] :: ExecOption -> Bool
+ Text.Regex.PDeriv.ByteString.TwoPasses: [caseSensitive] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.TwoPasses: [lastStarGreedy] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.TwoPasses: [multiline] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.TwoPasses: [newSyntax] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.TwoPasses: [rightAssoc] :: CompOption -> Bool
+ Text.Regex.PDeriv.ByteString.TwoPasses: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.TwoPasses.CompOption
+ Text.Regex.PDeriv.ByteString.TwoPasses: instance GHC.Read.Read Text.Regex.PDeriv.ByteString.TwoPasses.ExecOption
+ Text.Regex.PDeriv.ByteString.TwoPasses: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.TwoPasses.CompOption
+ Text.Regex.PDeriv.ByteString.TwoPasses: instance GHC.Show.Show Text.Regex.PDeriv.ByteString.TwoPasses.ExecOption
+ Text.Regex.PDeriv.ByteString.TwoPasses: instance Text.Regex.Base.RegexLike.RegexOptions Text.Regex.PDeriv.ByteString.TwoPasses.Regex Text.Regex.PDeriv.ByteString.TwoPasses.CompOption Text.Regex.PDeriv.ByteString.TwoPasses.ExecOption
+ Text.Regex.PDeriv.Common: instance GHC.Classes.Eq Text.Regex.PDeriv.Common.GFlag
+ Text.Regex.PDeriv.Common: instance GHC.Classes.Eq Text.Regex.PDeriv.Common.Range
+ Text.Regex.PDeriv.Common: instance GHC.Show.Show Text.Regex.PDeriv.Common.GFlag
+ Text.Regex.PDeriv.Common: instance GHC.Show.Show Text.Regex.PDeriv.Common.Range
+ Text.Regex.PDeriv.Dictionary: instance (Text.Regex.PDeriv.Dictionary.Key a, Text.Regex.PDeriv.Dictionary.Key b) => Text.Regex.PDeriv.Dictionary.Key (a, b)
+ Text.Regex.PDeriv.Dictionary: instance (Text.Regex.PDeriv.Dictionary.Key a, Text.Regex.PDeriv.Dictionary.Key b, Text.Regex.PDeriv.Dictionary.Key c) => Text.Regex.PDeriv.Dictionary.Key (a, b, c)
+ Text.Regex.PDeriv.Dictionary: instance Text.Regex.PDeriv.Dictionary.Key GHC.Types.Char
+ Text.Regex.PDeriv.Dictionary: instance Text.Regex.PDeriv.Dictionary.Key GHC.Types.Int
+ Text.Regex.PDeriv.Dictionary: instance Text.Regex.PDeriv.Dictionary.Key a => Text.Regex.PDeriv.Dictionary.Key [a]
+ Text.Regex.PDeriv.ExtPattern: instance GHC.Show.Show Text.Regex.PDeriv.ExtPattern.EPat
+ Text.Regex.PDeriv.IntPattern: instance GHC.Classes.Eq Text.Regex.PDeriv.IntPattern.Pat
+ Text.Regex.PDeriv.IntPattern: instance GHC.Show.Show Text.Regex.PDeriv.IntPattern.Pat
+ Text.Regex.PDeriv.IntPattern: instance Text.Regex.PDeriv.Common.IsEpsilon Text.Regex.PDeriv.IntPattern.Pat
+ Text.Regex.PDeriv.IntPattern: instance Text.Regex.PDeriv.Common.IsGreedy Text.Regex.PDeriv.IntPattern.Pat
+ Text.Regex.PDeriv.IntPattern: instance Text.Regex.PDeriv.Common.IsPhi Text.Regex.PDeriv.IntPattern.Pat
+ Text.Regex.PDeriv.IntPattern: instance Text.Regex.PDeriv.Common.Simplifiable Text.Regex.PDeriv.IntPattern.Pat
+ Text.Regex.PDeriv.IntPattern: instance Text.Regex.PDeriv.Dictionary.Key Text.Regex.PDeriv.IntPattern.Pat
+ Text.Regex.PDeriv.IntPattern: instance Text.Regex.PDeriv.Pretty.Pretty Text.Regex.PDeriv.IntPattern.Pat
+ Text.Regex.PDeriv.Nfa: [all_states] :: NFA s a -> [s]
+ Text.Regex.PDeriv.Nfa: [delta_states] :: NFA s a -> [(s, a, s)]
+ Text.Regex.PDeriv.Nfa: [final_states] :: NFA s a -> [s]
+ Text.Regex.PDeriv.Nfa: [init_states] :: NFA s a -> [s]
+ Text.Regex.PDeriv.Nfa: [mapping_states] :: SNFA s a -> s -> Int
+ Text.Regex.PDeriv.Nfa: [sall_states] :: SNFA s a -> [Int]
+ Text.Regex.PDeriv.Nfa: [sdelta_states] :: SNFA s a -> [(Int, a, Int)]
+ Text.Regex.PDeriv.Nfa: [sfinal_states] :: SNFA s a -> [Int]
+ Text.Regex.PDeriv.Nfa: [sinit_states] :: SNFA s a -> [Int]
+ Text.Regex.PDeriv.Nfa: instance (GHC.Show.Show a, GHC.Show.Show s) => GHC.Show.Show (Text.Regex.PDeriv.Nfa.NFA s a)
+ Text.Regex.PDeriv.Nfa: instance GHC.Show.Show a => GHC.Show.Show (Text.Regex.PDeriv.Nfa.SNFA s a)
+ Text.Regex.PDeriv.Parse: parseEPat :: String -> Either ParseError (EPat, EState)
+ Text.Regex.PDeriv.RE: instance GHC.Classes.Eq Text.Regex.PDeriv.RE.RE
+ Text.Regex.PDeriv.RE: instance GHC.Show.Show Text.Regex.PDeriv.RE.RE
+ Text.Regex.PDeriv.RE: instance Text.Regex.PDeriv.Common.IsEpsilon Text.Regex.PDeriv.RE.RE
+ Text.Regex.PDeriv.RE: instance Text.Regex.PDeriv.Common.IsGreedy Text.Regex.PDeriv.RE.RE
+ Text.Regex.PDeriv.RE: instance Text.Regex.PDeriv.Common.IsPhi Text.Regex.PDeriv.RE.RE
+ Text.Regex.PDeriv.RE: instance Text.Regex.PDeriv.Common.PosEpsilon Text.Regex.PDeriv.RE.RE
+ Text.Regex.PDeriv.RE: instance Text.Regex.PDeriv.Common.Simplifiable Text.Regex.PDeriv.RE.RE
+ Text.Regex.PDeriv.RE: instance Text.Regex.PDeriv.Dictionary.Key Text.Regex.PDeriv.RE.RE
+ Text.Regex.PDeriv.String: [captureGroups] :: ExecOption -> Bool
+ Text.Regex.PDeriv.String: [caseSensitive] :: CompOption -> Bool
+ Text.Regex.PDeriv.String: [lastStarGreedy] :: CompOption -> Bool
+ Text.Regex.PDeriv.String: [multiline] :: CompOption -> Bool
+ Text.Regex.PDeriv.String: [newSyntax] :: CompOption -> Bool
+ Text.Regex.PDeriv.String: [rightAssoc] :: CompOption -> Bool
+ Text.Regex.PDeriv.String.LeftToRightD: [captureGroups] :: ExecOption -> Bool
+ Text.Regex.PDeriv.String.LeftToRightD: [caseSensitive] :: CompOption -> Bool
+ Text.Regex.PDeriv.String.LeftToRightD: [lastStarGreedy] :: CompOption -> Bool
+ Text.Regex.PDeriv.String.LeftToRightD: [multiline] :: CompOption -> Bool
+ Text.Regex.PDeriv.String.LeftToRightD: [newSyntax] :: CompOption -> Bool
+ Text.Regex.PDeriv.String.LeftToRightD: [rightAssoc] :: CompOption -> Bool
+ Text.Regex.PDeriv.String.LeftToRightD: instance GHC.Read.Read Text.Regex.PDeriv.String.LeftToRightD.CompOption
+ Text.Regex.PDeriv.String.LeftToRightD: instance GHC.Read.Read Text.Regex.PDeriv.String.LeftToRightD.ExecOption
+ Text.Regex.PDeriv.String.LeftToRightD: instance GHC.Show.Show Text.Regex.PDeriv.String.LeftToRightD.CompOption
+ Text.Regex.PDeriv.String.LeftToRightD: instance GHC.Show.Show Text.Regex.PDeriv.String.LeftToRightD.ExecOption
+ Text.Regex.PDeriv.String.LeftToRightD: instance Text.Regex.Base.RegexLike.RegexOptions Text.Regex.PDeriv.String.LeftToRightD.Regex Text.Regex.PDeriv.String.LeftToRightD.CompOption Text.Regex.PDeriv.String.LeftToRightD.ExecOption
+ Text.Regex.PDeriv.Translate: instance GHC.Show.Show Text.Regex.PDeriv.Translate.TState
- Text.Regex.PDeriv.Nfa: nofDelta :: NFA t t1 -> Int
+ Text.Regex.PDeriv.Nfa: nofDelta :: NFA t1 t -> Int
Files
- Text/Regex/PDeriv/ByteString/LeftToRight.lhs +2/−1
- Text/Regex/PDeriv/ByteString/LeftToRightS.lhs +430/−0
- Text/Regex/PDeriv/ByteString/Posix.lhs +0/−1
- Text/Regex/PDeriv/ByteString/RightToLeft.lhs +1/−2
- Text/Regex/PDeriv/ByteString/TwoPasses.lhs +0/−1
- Text/Regex/PDeriv/Parse.lhs +1/−1
- Text/Regex/PDeriv/RE.lhs +2/−2
- Text/Regex/PDeriv/String/LeftToRightD.lhs +0/−1
- regex-pderiv.cabal +9/−1
Text/Regex/PDeriv/ByteString/LeftToRight.lhs view
@@ -20,7 +20,6 @@ > , regexec > ) where - > import Prelude hiding (Word) > import Data.List > import Data.Char (ord)@@ -179,6 +178,7 @@ > -} > patMatchesIntStatePdPat0 :: Int -> PdPat0Table -> Word -> [(Int,Binder)] -> [(Int,Binder)]+> -- patMatchesIntStatePdPat0 cnt pdStateTable w' [] = [] -- optimization: fail early > patMatchesIntStatePdPat0 cnt pdStateTable w' eps = > case {-# SCC "uncons" #-} S.uncons w' of > Nothing -> eps @@ -195,6 +195,7 @@ > patMatchesIntStatePdPat0' :: Int -> PdPat0Table -> Word -> [(Int,[Binder -> Binder])] -> [(Int,[Binder -> Binder])]+> -- patMatchesIntStatePdPat0' cnt pdStateTable w' [] = [] -- optimization: fail early > patMatchesIntStatePdPat0' cnt pdStateTable w' eps = > case {-# SCC "uncons" #-} S.uncons w' of > Nothing -> eps
+ Text/Regex/PDeriv/ByteString/LeftToRightS.lhs view
@@ -0,0 +1,430 @@+> {- By Kenny Zhuo Ming Lu and Martin Sulzmann, 2009, BSD License -}++A bytestring implementation of reg exp pattern matching using partial derivative+This algorithm exploits the extension of partial derivative of regular expression patterns.+This algorithm proceeds by scanning the input word from left to right until we reach +an emptiable pattern and the input word is fully consumed.+++eliminating the list of env update functions, by applying them on the flight++> {-# LANGUAGE GADTs, MultiParamTypeClasses, FunctionalDependencies,+> FlexibleInstances, TypeSynonymInstances, FlexibleContexts #-} +++> module Text.Regex.PDeriv.ByteString.LeftToRightS+> ( Regex+> , CompOption(..)+> , ExecOption(..)+> , defaultCompOpt+> , defaultExecOpt+> , compile+> , execute+> , regexec+> ) where ++> import Prelude hiding (Word)+> import Data.List +> import Data.Char (ord)+> -- import GHC.Int+> import qualified Data.IntMap as IM+> import qualified Data.ByteString.Char8 as S+> import Control.DeepSeq++> import System.IO.Unsafe (unsafePerformIO)++> import Text.Regex.Base(RegexOptions(..))++> import Control.Parallel.Strategies+> import Text.Regex.PDeriv.RE+> import Text.Regex.PDeriv.Pretty (Pretty(..))+> import Text.Regex.PDeriv.Common (Range(..), Letter, PosEpsilon(..), Simplifiable(..), my_hash, my_lookup, GFlag(..), nub2, preBinder, mainBinder, subBinder)+> import Text.Regex.PDeriv.IntPattern (Pat(..), pdPat, pdPat0, pdPat0Sim, toBinder, Binder(..), strip, listifyBinder)+> import Text.Regex.PDeriv.Parse+> import qualified Text.Regex.PDeriv.Dictionary as D (Dictionary(..), Key(..), insertNotOverwrite, lookupAll, empty, isIn, nub)++++A word is a byte string.++> type Word = S.ByteString+++----------------------------+-- (greedy) pattern matching++> type Env = [(Int,Word)]++> rg_collect :: S.ByteString -> Range -> S.ByteString+> rg_collect w (Range i j) = S.take (j' - i' + 1) (S.drop i' w)+> where i' = fromIntegral i+> j' = fromIntegral j++++we compile all the possible partial derivative operation into a table+The table maps key to a set of target integer states and their corresponding+binder update functions. ++> type PdPat0Table = IM.IntMap [(Int, Int -> Binder -> Binder)]++A function that builds the above table from the pattern++> buildPdPat0Table :: Pat -> (PdPat0Table, [Int])+> buildPdPat0Table init = +> let sig = map (\x -> (x,0)) (sigmaRE (strip init)) -- the sigma+> init_dict = D.insertNotOverwrite (D.hash init) (init,0) D.empty -- add init into the initial dictionary+> (all, delta, dictionary) = sig `seq` builder sig [] [] [init] init_dict 1 -- all states and delta+> final = all `seq` [ s | s <- all, posEpsilon (strip s)] -- the final states+> sfinal = final `seq` dictionary `seq` map (mapping dictionary) final+> lists = [ (i,l,jfs) | +> (p,l, qfs) <- delta, +> let i = mapping dictionary p+> jfs = map (\(q,f) -> (mapping dictionary q, f)) qfs+> ]+> hash_table = foldl' (\ dict (p,x,q) -> +> let k = my_hash p (fst x)+> in case IM.lookup k dict of +> Just ps -> error "Found a duplicate key in the PdPat0Table, this should not happen."+> Nothing -> IM.insert k q dict) IM.empty lists+> in (hash_table, sfinal)++Some helper functions used in buildPdPat0Table++> myLookup = lookup++> mapping :: D.Dictionary (Pat,Int) -> Pat -> Int+> mapping dictionary x = let candidates = D.lookupAll (D.hash x) dictionary+> in candidates `seq` +> case candidates of+> [(_,i)] -> i+> _ -> +> case myLookup x candidates of+> (Just i) -> i+> Nothing -> error ("this should not happen. looking up " ++ (pretty x) ++ " from " ++ (show candidates) )++> builder :: [Letter] +> -> [Pat] +> -> [(Pat,Letter, [(Pat, Int -> Binder -> Binder)] )]+> -> [Pat] +> -> D.Dictionary (Pat,Int)+> -> Int +> -> ([Pat], [(Pat, Letter, [(Pat, Int -> Binder -> Binder)])], D.Dictionary (Pat,Int))+> builder sig acc_states acc_delta curr_states dict max_id +> | null curr_states = (acc_states, acc_delta, dict)+> | otherwise = +> let +> all_sofar_states = acc_states ++ curr_states+> new_delta = [ (s, l, sfs) | s <- curr_states, l <- sig, let sfs = pdPat0 s l]+> new_states = all_sofar_states `seq` D.nub [ s' | (_,_,sfs) <- new_delta, (s',f) <- sfs+> , not (s' `D.isIn` dict) ]+> acc_delta_next = (acc_delta ++ new_delta)+> (dict',max_id') = new_states `seq` foldl' (\(d,id) p -> (D.insertNotOverwrite (D.hash p) (p,id) d, id + 1) ) (dict,max_id) new_states+> in {- dict' `seq` max_id' `seq` -} builder sig all_sofar_states acc_delta_next new_states dict' max_id' ++++the "partial derivative" operations among integer states + binders++> lookupPdPat0 :: PdPat0Table -> (Int,Binder) -> Letter -> [(Int,Binder)]+> lookupPdPat0 hash_table (i,binder) (l,x) = +> -- i `seq` +> -- l `seq` +> -- k `seq` +> let k = {-# SCC "hash" #-} (my_hash i l)+> in k `seq`+> hash_table `seq`+> case {-# SCC "lookup" #-} IM.lookup k hash_table of+> { Just pairs -> +> binder `seq` -- x `seq`+> -- {-# SCC "pair" #-} [ binder' `seq` (j, binder' ) | (j, op) <- {-# SCC "pair_pair" #-} pairs, let binder' = {-# SCC "pair_binder" #-} op x binder ]+> {-# SCC "pair" #-} map (\ (j,op) -> let binder' = {-# SCC "pair_binder" #-} op x binder +> in binder' `seq` +> {-# SCC "pair_pair" #-} (j, binder' ) ) pairs +> ; Nothing -> [] +> }+++> lookupPdPat0' :: PdPat0Table -> (Int, [Binder -> Binder]) -> Letter -> [(Int,[Binder -> Binder])]+> lookupPdPat0' hash_table (i,fs) (l,x) = +> -- i `seq` +> -- l `seq` +> -- k `seq` +> let k = {-# SCC "hash" #-} (my_hash i l)+> in k `seq`+> hash_table `seq`+> case {-# SCC "lookup" #-} IM.lookup k hash_table of+> { Just pairs -> +> let io = unsafePerformIO (print (length pairs))+> in+> x `seq` -- io `seq`+> {-# SCC "pair" #-} map (\ (j,op) -> let f = {-# SCC "op_x" #-} op x +> fs' = {-# SCC "fs'" #-} {- f `seq` fs `seq` -} f:fs+> in {- fs' `seq` -} (j, fs')) pairs +> ; Nothing -> [] +> }+++collection function for binder ++> collectPatMatchFromBinder :: Word -> Binder -> Env+> collectPatMatchFromBinder w b = +> collectPatMatchFromBinder_ w (listifyBinder b)++> collectPatMatchFromBinder_ w [] = []+> collectPatMatchFromBinder_ w ((x,[]):xs) = (x,S.empty):(collectPatMatchFromBinder_ w xs)+> collectPatMatchFromBinder_ w ((x,rs):xs) = (x,foldl' S.append S.empty $ map (rg_collect w) (reverse rs)):(collectPatMatchFromBinder_ w xs)+> {-+> (x, f w rs):(collectPatMatchFromBinder_ w xs)+> where f w [] = S.empty+> f w (r:_) = rg_collect w r+> -}++> patMatchesIntStatePdPat0 :: Int -> PdPat0Table -> Word -> [(Int,Binder)] -> [(Int,Binder)]+> -- patMatchesIntStatePdPat0 cnt pdStateTable w' [] = [] -- optimization: fail early+> patMatchesIntStatePdPat0 cnt pdStateTable w' eps =+> case {-# SCC "uncons" #-} S.uncons w' of +> Nothing -> eps +> Just (l,w) -> +> let +> eps_ = -- l `seq` cnt `seq` +> {-# SCC "listcompred" #-} concatMap (\ep -> lookupPdPat0 pdStateTable ep (l,cnt)) eps+> eps' = -- eps_ `seq`+> nub2 eps_+> cnt' = cnt + 1+> in cnt' `seq` {- pdStateTable `seq` -} w `seq` +> eps' `seq` +> patMatchesIntStatePdPat0 cnt' pdStateTable w eps'++++++> concatMap' :: (a -> [b]) -> [a] -> [b]+> concatMap' f x = foldr' ( \ b a -> (++) a (f b) ) [] x++> foldr' :: (a -> b -> b) -> b -> [a] -> b+> foldr' f b [] = b+> foldr' f b (a:as) = let b' = f a b +> in b' `seq` +> foldr' f b' as++> {- +> fast_nub :: [(Binder,Int)] -> [(Binder,Int)]+> fast_nub eps = +> let im = IM.empty +> in fast_nub' im eps+> where fast_nub' :: IM.IntMap () -> [(Binder,Int)] -> [(Binder,Int)]+> fast_nub' im [] = []+> fast_nub' im ((e,p):eps) = +> let mb_r = IM.lookup p im+> in case mb_r of+> Just _ -> fast_nub' im eps+> Nothing -> let im' = IM.insert p () im+> in (e,p):(fast_nub' im' eps)+> -}+++> patMatchIntStatePdPat0 :: Pat -> Word -> [Env]+> patMatchIntStatePdPat0 p w = +> let+> (pdStateTable,sfinal) = buildPdPat0Table p+> s = 0+> b = toBinder p+> allbinders' = b `seq` s `seq` pdStateTable `seq` (patMatchesIntStatePdPat0 0 pdStateTable w [(s,b)])+> allbinders = allbinders' `seq` map snd (filter (\(i,_) -> i `elem` sfinal) allbinders' )+> -- all_func' = s `seq` pdStateTable `seq` (patMatchesIntStatePdPat0' 0 pdStateTable w [(s,[])])+> -- all_func = all_func' `seq` map snd (filter (\(i,_) -> i `elem` sfinal) all_func' ) +> in map (collectPatMatchFromBinder w) $! allbinders+> -- map (\fs -> collectPatMatchFromBinder w (applyAll (reverse fs) b)) $! all_func +++++> greedyPatMatch :: Pat -> Word -> Maybe Env+> greedyPatMatch p w =+> first (patMatchIntStatePdPat0 p w)+> where+> first (env:_) = return env+> first _ = Nothing++Compilation+++> compilePat :: Pat -> (PdPat0Table, [Int], Binder)+> compilePat p = (pdStateTable, sfinal, b)+> where +> (pdStateTable,sfinal) = buildPdPat0Table p+> b = toBinder p++> patMatchIntStateCompiled :: (PdPat0Table, [Int], Binder) -> Word -> [Env]+> patMatchIntStateCompiled (pdStateTable,sfinal,b) w = +> let+> s = 0 +> allbinders' = b `seq` s `seq` pdStateTable `seq` (patMatchesIntStatePdPat0 0 pdStateTable w [(s,b)]) +> allbinders = allbinders' `seq` map snd (filter (\(i,_) -> i `elem` sfinal) allbinders' )+> -- all_func' = s `seq` pdStateTable `seq` (patMatchesIntStatePdPat0' 0 pdStateTable w [(s,[])])+> -- all_func = all_func' `seq` map snd (filter (\(i,_) -> i `elem` sfinal) all_func' ) +> in map (collectPatMatchFromBinder w) allbinders+> {- all_func `seq` +> map (\fs -> let fs' = reverse fs+> in fs' `seq` collectPatMatchFromBinder w (applyAll fs' b)) all_func +> -}+> applyAll :: [ Binder -> Binder ] -> Binder -> Binder+> -- applyAll _ b = b -- fixme+> applyAll [] b = b+> applyAll (f:fs) b = let b' = f b+> in b' `seq` applyAll fs b'+ +++> greedyPatMatchCompiled :: (PdPat0Table, [Int], Binder) -> Word -> Maybe Env+> greedyPatMatchCompiled compiled w =+> first (patMatchIntStateCompiled compiled w)+> where+> first (env:_) = return env+> first _ = Nothing++++++> -- | The PDeriv backend spepcific 'Regex' type++> newtype Regex = Regex (PdPat0Table, [Int], Binder) +++-- todo: use the CompOption and ExecOption++> compile :: CompOption -- ^ Flags (summed together)+> -> ExecOption -- ^ Flags (summed together) +> -> S.ByteString -- ^ The regular expression to compile+> -> Either String Regex -- ^ Returns: the compiled regular expression+> compile compOpt execOpt bs =+> case parsePat (S.unpack bs) of+> Left err -> Left ("parseRegex for Text.Regex.PDeriv.ByteString failed:"++show err)+> Right pat -> Right (patToRegex pat compOpt execOpt)+> where +> patToRegex p _ _ = Regex (compilePat $ simplify p)++++> execute :: Regex -- ^ Compiled regular expression+> -> S.ByteString -- ^ ByteString to match against+> -> Either String (Maybe Env)+> execute (Regex r) bs = Right (greedyPatMatchCompiled r bs)++> regexec :: Regex -- ^ Compiled regular expression+> -> S.ByteString -- ^ ByteString to match against+> -> Either String (Maybe (S.ByteString, S.ByteString, S.ByteString, [S.ByteString]))+> regexec (Regex r) bs =+> case greedyPatMatchCompiled r bs of+> Nothing -> Right (Nothing)+> Just env ->+> let pre = case lookup preBinder env of { Just w -> w ; Nothing -> S.empty }+> post = case lookup subBinder env of { Just w -> w ; Nothing -> S.empty }+> {- full_len = S.length bs+> pre_len = S.length pre+> post_len = S.length post+> main_len = full_len - pre_len - post_len+> main_and_post = S.drop pre_len bs+> main = main_and_post `seq` main_len `seq` S.take main_len main_and_post -}+> main = case lookup mainBinder env of { Just w -> w ; Nothing -> S.empty }+> matched = map snd (filter (\(v,w) -> v > 0) env)+> in Right (Just (pre,main,post,matched))+++> -- | Control whether the pattern is multiline or case-sensitive like Text.Regex and whether to+> -- capture the subgroups (\1, \2, etc). Controls enabling extra anchor syntax.+> data CompOption = CompOption {+> caseSensitive :: Bool -- ^ True in blankCompOpt and defaultCompOpt+> , multiline :: Bool +> {- ^ False in blankCompOpt, True in defaultCompOpt. Compile for+> newline-sensitive matching. "By default, newline is a completely ordinary+> character with no special meaning in either REs or strings. With this flag,+> inverted bracket expressions and . never match newline, a ^ anchor matches the+> null string after any newline in the string in addition to its normal+> function, and the $ anchor matches the null string before any newline in the+> string in addition to its normal function." -}+> , rightAssoc :: Bool -- ^ True (and therefore Right associative) in blankCompOpt and defaultCompOpt+> , newSyntax :: Bool -- ^ False in blankCompOpt, True in defaultCompOpt. +> , lastStarGreedy :: Bool -- ^ False by default. This is POSIX correct but it takes space and is slower.+> -- Setting this to true will improve performance, and should be done+> -- if you plan to set the captureGroups execoption to False.+> } deriving (Read,Show)++> data ExecOption = ExecOption {+> captureGroups :: Bool -- ^ True by default. Set to False to improve speed (and space).+> } deriving (Read,Show)++> instance RegexOptions Regex CompOption ExecOption where+> blankCompOpt = CompOption { caseSensitive = True+> , multiline = False+> , rightAssoc = True+> , newSyntax = False+> , lastStarGreedy = False+> }+> blankExecOpt = ExecOption { captureGroups = True }+> defaultCompOpt = CompOption { caseSensitive = True+> , multiline = True+> , rightAssoc = True+> , newSyntax = True+> , lastStarGreedy = False+> }+> defaultExecOpt = ExecOption { captureGroups = True }+> setExecOpts e r = undefined+> getExecOpts r = undefined +++-- Kenny's example++> long_pat = PPair (PVar 1 [] (PE (Star (L 'A') Greedy))) (PVar 2 [] (PE (Star (L 'A') Greedy)))+> long_string n = S.pack $ (take 0 (repeat 'A')) ++ (take n (repeat 'B'))++-- p4 = << x : (A|<A,B>), y : (<B,<A,A>>|A) >, z : (<A,C>|C) > ++> p4 = PPair (PPair p_x p_y) p_z+> where p_x = PVar 1 [] (PE (Choice (L 'A') (Seq (L 'A') (L 'B')) Greedy)) +> p_y = PVar 2 [] (PE (Choice (Seq (L 'B') (Seq (L 'A') (L 'A'))) (L 'A') Greedy))+> p_z = PVar 3 [] (PE (Choice (Seq (L 'A') (L 'C')) (L 'C') Greedy))++> input = S.pack "ABAAC" -- long(posix) vs greedy match+++> p5 = PStar (PVar 1 [] (PE (Choice (L 'A') (Choice (L 'B') (L 'C') Greedy) Greedy))) Greedy++pattern = ( x :: (A|C), y :: (B|()) )*++> p6 = PStar (PPair (PVar 1 [] (PE (Choice (L 'A') (L 'C') Greedy))) (PVar 2 [] (PE (Choice (L 'B') Empty Greedy)))) Greedy++pattern = ( x :: ( y :: A, z :: B )* )++> p7 = PVar 1 [] (PStar (PPair (PVar 2 [] (PE (L 'A'))) (PVar 3 [] (PE (L 'B')))) Greedy)++> input7 = S.pack "ABABAB"+++pattern = ( x :: A*?, y :: A*)++> p8 = PPair (PVar 1 [] (PE (Star (L 'A') NotGreedy))) (PVar 2 [] (PE (Star (L 'A') Greedy)))++> input8 = S.pack "AAAAAA"++pattern = ( x :: A*?, y :: A*)++> p9 = PPair (PStar (PVar 1 [] (PE (L 'A'))) NotGreedy) (PVar 2 [] (PE (Star (L 'A') Greedy)))++pattern = ( x :: (A|B)*?, (y :: (B*,A*)))++> p10 = PPair (PVar 1 [] (PE (Star (Choice (L 'A') (L 'B') Greedy) NotGreedy))) (PVar 2 [] (PE (Seq (Star (L 'B') Greedy) (Star (L 'A') Greedy))))++> input10 = S.pack "ABA"+++pattern = <(x :: (0|...|9)+?)*, (y :: (0|...|9)+?)*, (z :: (0|...|9)+?)*>++> digits_re = foldl' (\x y -> Choice x y Greedy) (L '0') (map L "12345789")++> p11 = PPair (PStar (PVar 1 [] (PE (Seq digits_re (Star digits_re Greedy)))) Greedy) (PPair (PStar (PVar 2 [] (PE (Seq digits_re (Star digits_re Greedy)))) Greedy) (PPair (PStar (PVar 3 [] (PE (Seq digits_re (Star digits_re Greedy)))) Greedy) (PStar (PVar 4 [] (PE (Seq digits_re (Star digits_re Greedy)))) Greedy)))++> input11 = S.pack "1234567890123456789-"
Text/Regex/PDeriv/ByteString/Posix.lhs view
@@ -26,7 +26,6 @@ > , regexec > ) where - > import Prelude hiding (Word) > import System.IO.Unsafe
Text/Regex/PDeriv/ByteString/RightToLeft.lhs view
@@ -20,8 +20,7 @@ > , execute > , regexec > , parsePat-> ) where -+> ) where > import Prelude hiding (Word) > import Data.List
Text/Regex/PDeriv/ByteString/TwoPasses.lhs view
@@ -23,7 +23,6 @@ > , regexec > ) where - > import Prelude hiding (Word) > import Data.List > import Data.Char (ord)
Text/Regex/PDeriv/Parse.lhs view
@@ -1,5 +1,5 @@ > {-# LANGUAGE FlexibleContexts #-}-> module Text.Regex.PDeriv.Parse (parsePat, parsePatPosix) where+> module Text.Regex.PDeriv.Parse (parsePat, parseEPat, parsePatPosix) where > {- By Kenny Zhuo Ming Lu and Martin Sulzmann, 2009. BSD3 -}
Text/Regex/PDeriv/RE.lhs view
@@ -161,8 +161,8 @@ > in s `seq` nub s > sigmaREsub (L l) = [l]-> sigmaREsub Any = map chr [32 .. 127]-> sigmaREsub (Not cs) = filter (\c -> not (c `elem` cs)) (map chr [32 .. 127])+> sigmaREsub Any = map chr [0 .. 127] -- [32 .. 127]+> sigmaREsub (Not cs) = filter (\c -> not (c `elem` cs)) $ map chr [0 .. 127] -- [32 .. 127] > sigmaREsub (Seq r1 r2) = (sigmaREsub r1) ++ (sigmaREsub r2) > sigmaREsub (Choice r1 r2 g) = (sigmaREsub r1) ++ (sigmaREsub r2) > sigmaREsub (Star r g) = sigmaREsub r
Text/Regex/PDeriv/String/LeftToRightD.lhs view
@@ -20,7 +20,6 @@ > , regexec > ) where - > import Prelude hiding (Word) > import Data.List > import Data.Char (ord)
regex-pderiv.cabal view
@@ -1,5 +1,5 @@ Name: regex-pderiv-Version: 0.1.4+Version: 0.2.0 License: BSD3 License-File: LICENSE Copyright: Copyright (c) 2010-2012, Kenny Zhuo Ming Lu and Martin Sulzmann@@ -25,6 +25,14 @@ Text.Regex.PDeriv.ByteString.TwoPasses Text.Regex.PDeriv.ByteString.RightToLeft Text.Regex.PDeriv.ByteString.LeftToRight+ Text.Regex.PDeriv.ByteString.LeftToRightS+ -- Text.Regex.PDeriv.ByteString.LeftToRightP+ -- Text.Regex.PDeriv.ByteString.LeftToRightP2+ -- Text.Regex.PDeriv.ByteString.LeftToRightP3+ -- Text.Regex.PDeriv.ByteString.LeftToRightP4+ -- Text.Regex.PDeriv.ByteString.LeftToRightP5+ -- Text.Regex.PDeriv.ByteString.LeftToRightP6+ -- Text.Regex.PDeriv.ByteString.LeftToRightP7 Text.Regex.PDeriv.ByteString.LeftToRightD Text.Regex.PDeriv.ByteString.Posix Text.Regex.PDeriv.String