regex-0.6.0.0: Toolkit for regex-base

Safe HaskellNone
LanguageHaskell2010

Text.RE.TestBench

Synopsis

Documentation

newtype MacroID Source

Constructors

MacroID 

Fields

getMacroID :: String
 

Instances

Eq MacroID 
Ord MacroID 
Show MacroID 
IsString MacroID 
Hashable MacroID 
IsOption (Macros RE) RE CompOption ExecOption 

data RegexType Source

what kind of back end will be compiling the RE, and its match function

Constructors

TDFA TestBenchMatcher 
PCRE TestBenchMatcher 

Instances

isTDFA :: RegexType -> Bool Source

test RegexType for TDFA/PCREness

isPCRE :: RegexType -> Bool Source

test RegexType for TDFA/PCREness

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 

data MacroDescriptor Source

describes a macro, giving the text of the RE and a si=ummary description

Constructors

MacroDescriptor 

Fields

_md_source :: !RegexSource

the RE

_md_samples :: ![String]

some sample matches

_md_counter_samples :: ![String]

some sample non-matches

_md_test_results :: ![TestResult]

validation test results

_md_parser :: !(Maybe FunctionID)

WA, the parser function

_md_description :: !String

summary comment

newtype TestResult Source

list of failures on a validation run

Constructors

TestResult 

Fields

_TestResult :: String
 

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

_RegexSource :: String
 

newtype FunctionID Source

name of the Haskell parser function for parsing the text matched by a macro

Constructors

FunctionID 

Fields

_FunctionID :: String
 

mkMacros :: (Monad m, Functor m) => (String -> m r) -> RegexType -> WithCaptures -> MacroEnv -> m (Macros r) Source