|
|
BaseMatcher
A base class that provides support to all matchers.
|
|
|
TreeStr
|
|
|
OperatorMatcher
A base class that provides support to all matchers with operators.
|
|
|
Transformable
All subclasses must expose and apply wrapper, and implement compose.
|
|
|
BaseFactoryMatcher
This must be used as a mixin with something that inherits from
ArgsAsAttribute (ie the usual matcher classes).
|
|
|
TransformableWrapper
A common support class for various wrappers.
|
|
|
TransformableTrampolineWrapper
A wrapper for source of generators that evaluate other matchers via
the trampoline (ie for generators that evaluate matchers via yield).
|
|
|
TrampolineWrapper
A wrapper for source of generators that evaluate other matchers via
the trampoline (ie for generators that evaluate matchers via yield).
|
|
|
NoTrampoline
A matcher that does not require the trampoline.
|
|
|
NoTrampolineWrapper
A wrapper for source of generators that do not evaluate other matchers via
the trampoline.
|
|
|
SequenceWrapper
A wrapper for simple generator factories, where the final matcher is a
function that yields a series of matches without evaluating other matchers
via the trampoline.
|
|
|
FunctionWrapper
A wrapper for simple function factories, where the final matcher is a
function that returns a single match or None.
|
|
|
check_matcher(matcher)
Check that the signature takes support + stream. |
source code
|
|
|
|
check_args(func)
Check that the factory doesn't use any of those modern haifalutin
extensions... |
source code
|
|
|
|
check_modifiers(func,
modifiers)
Check that any modifiers match the function declaration. |
source code
|
|
|
|
apply_modifiers(func,
args,
kargs,
modifiers,
margs,
mkargs)
Modify values in args and kargs. |
source code
|
|
|
|
make_wrapper_factory(wrapper,
factory,
modifiers,
margs=identity,
mkargs=identity,
memo=True)
A helper function that assembles a matcher from a wrapper class and
a factory function that contains the logic. |
source code
|
|
|
|
make_factory(maker,
matcher)
A helper function that assembles a matcher from a wrapper class and
a function that contains the logic. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
sequence_matcher_factory(gatekeeper_=None,
args_=identity,
kargs_=identity,
**kargs)
Decorator that allows matchers to be defined using a nested pair
of functions. |
source code
|
|
|
|
sequence_matcher(matcher)
Decorator that allows matchers to be defined using a single function
to implement the matcher logic. |
source code
|
|
|
|
function_matcher_factory(gatekeeper_=None,
args_=identity,
kargs_=identity,
**kargs)
Decorator that allows matchers to be defined using a nested pair
of functions. |
source code
|
|
|
|
function_matcher(matcher)
Decorator that allows matchers to be defined using a single function
to implement the matcher logic. |
source code
|
|
|
|
coerce_(arg,
function=None)
Many arguments can take a string which is implicitly converted (via this
function) to a literal (or similar). |
source code
|
|
|
|
to(function)
Generate a coercion for later application. |
source code
|
|