Safe Haskell | None |
---|---|
Language | Haskell2010 |
Text.RE.TestBench
- newtype MacroID = MacroID {}
- data RegexType
- type MacroEnv = HashMap MacroID MacroDescriptor
- data WithCaptures
- data MacroDescriptor = MacroDescriptor {}
- newtype TestResult = TestResult {}
- newtype RegexSource = RegexSource {}
- newtype FunctionID = FunctionID {}
- mkMacros :: (Monad m, Functor m) => (String -> m r) -> RegexType -> WithCaptures -> MacroEnv -> m (Macros r)
- testMacroEnv :: String -> RegexType -> MacroEnv -> IO Bool
- badMacros :: MacroEnv -> [MacroID]
- runTests :: (Eq a, Show a) => RegexType -> (String -> Maybe a) -> [(String, a)] -> MacroEnv -> MacroID -> MacroDescriptor -> MacroDescriptor
- runTests' :: (Eq a, Show a) => RegexType -> (Match String -> Maybe a) -> [(String, a)] -> MacroEnv -> MacroID -> MacroDescriptor -> MacroDescriptor
- formatMacroTable :: RegexType -> MacroEnv -> String
- dumpMacroTable :: String -> RegexType -> MacroEnv -> IO ()
- formatMacroSummary :: RegexType -> MacroEnv -> MacroID -> String
- formatMacroSources :: RegexType -> WithCaptures -> MacroEnv -> String
- formatMacroSource :: RegexType -> WithCaptures -> MacroEnv -> MacroID -> String
- testMacroDescriptors :: [MacroDescriptor] -> [TestResult]
- regexSource :: RegexType -> WithCaptures -> RegexSource -> String
Documentation
what kind of back end will be compiling the RE
type MacroEnv = HashMap MacroID MacroDescriptor Source
each macro can reference others, the whole environment being required for each macro, so we use a Lazy HashMap
data WithCaptures Source
do we need the captures in the RE or whould they be stripped out where possible
Constructors
InclCaptures | |
ExclCaptures |
Instances
data MacroDescriptor Source
describes a macro, giving the text of the RE and a si=ummary description
Constructors
MacroDescriptor | |
Fields
|
Instances
newtype RegexSource Source
a RE that should work for POSIX and PCRE with open brackets ('(') represented as follows: ( mere symbol (?: used for grouping only, not for captures (}: used for captures only, not for grouping (]: used for captures and grouping ( do not modify
Constructors
RegexSource | |
Fields |
Instances
newtype FunctionID Source
name of the Haskell parser function for parsing the text matched by a macro
Constructors
FunctionID | |
Fields |
Instances
mkMacros :: (Monad m, Functor m) => (String -> m r) -> RegexType -> WithCaptures -> MacroEnv -> m (Macros r) Source
runTests :: (Eq a, Show a) => RegexType -> (String -> Maybe a) -> [(String, a)] -> MacroEnv -> MacroID -> MacroDescriptor -> MacroDescriptor Source
runTests' :: (Eq a, Show a) => RegexType -> (Match String -> Maybe a) -> [(String, a)] -> MacroEnv -> MacroID -> MacroDescriptor -> MacroDescriptor Source
formatMacroTable :: RegexType -> MacroEnv -> String Source
formatMacroSources :: RegexType -> WithCaptures -> MacroEnv -> String Source
formatMacroSource :: RegexType -> WithCaptures -> MacroEnv -> MacroID -> String Source
testMacroDescriptors :: [MacroDescriptor] -> [TestResult] Source
regexSource :: RegexType -> WithCaptures -> RegexSource -> String Source