Combines two SingleElementContextMatcher
s such that the resulting matcher will succeed if both the
right
and left
matchers succeed, and returns the results of both matchers (as a tuple, but reduced
via the TypeReduce
rules)
SingleElementContextMatcher that delegates to the given function f
to perform its match.
Similar to ContextMatcher.Mapped
, but specialized for SingleElementContextMatcher
Similar to ContextMatcher.Or
, but specialized for SingleElementContextMatcher
SingleElementContextMatcher that successfully matches (with no result) if the
given predicate function returns true
for the matched element.
Create a new single-element matcher which calls the given matcher function f
on the first
element of the stack.
Create a new single-element matcher which calls the given matcher function f
on the first
element of the stack. If f
returns None
, the match fails, otherwise, the match succeeds.
The match result type
This value will be used as the matcher's toString
The matcher function
A new single-element matcher which applies f
to the stack head
Create a new single-element matcher which calls the given matcher function f
on the first
element of the stack.
Create a new single-element matcher which calls the given matcher function f
on the first
element of the stack. If f
returns None
, the match fails, otherwise, the match succeeds.
The match result type
The matcher function
A new single-element matcher which applies f
to the stack head
Create a new single-element matcher which calls the given predicate function f
on the first
element of the stack.
Create a new single-element matcher which calls the given predicate function f
on the first
element of the stack. If f
returns true
, the match succeeds. Otherwise, the match fails.
This value will be used as the matcher's toString
The predicate function
A new single-element matcher which uses f
to determine a match
Create a new single-element matcher which calls the given predicate function f
on the first
element of the stack.
Create a new single-element matcher which calls the given predicate function f
on the first
element of the stack. If f
returns true
, the match succeeds. Otherwise, the match fails.
The predicate function
A new single-element matcher which uses f
to determine a match