regex-0.11.0.0: Toolkit for regex-base

Safe HaskellNone
LanguageHaskell2010

Text.RE.ZeInternals.TestBench

Synopsis

Documentation

newtype MacroID Source #

MacroID is just a wrapped String type with an IsString instance

Constructors

MacroID 

Fields

data RegexType Source #

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

mkTDFA :: TestBenchMatcher -> RegexType Source #

mkPCRE :: TestBenchMatcher -> RegexType Source #

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

include all captures

ExclCaptures

remove captures where possible

data MacroDescriptor Source #

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

Constructors

MacroDescriptor 

Fields

newtype TestResult Source #

list of failures on a validation run

Constructors

TestResult 

Fields

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

newtype FunctionID Source #

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

Constructors

FunctionID 

Fields

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

construct a macro table suitable for use with the RE compilers

testMacroEnv :: String -> RegexType -> MacroEnv -> IO Bool Source #

test that a MacroEnv is passing all of its built-in tests

formatMacroTable :: RegexType -> MacroEnv -> String Source #

format a macros table as a markdown table

dumpMacroTable :: String -> RegexType -> MacroEnv -> IO () Source #

dump a MacroEnv into the docs directory

formatMacroSummary :: RegexType -> MacroEnv -> MacroID -> String Source #

generate a plain text summary of a macro

formatMacroSources :: RegexType -> WithCaptures -> MacroEnv -> String Source #

list the source REs for each macro in plain text

formatMacroSource :: RegexType -> WithCaptures -> MacroEnv -> MacroID -> String Source #

list the source of a single macro in plain text