Skip to content

Latest commit

 

History

History
37 lines (21 loc) · 770 Bytes

Any.pod

File metadata and controls

37 lines (21 loc) · 770 Bytes

NAME

Tree::Pattern::Any - Match any of a list of patterns.

DESCRIPTION

Tree::Pattern::Any patterns match any object that matches any of their subpatterns, similar to Perl 6's junctions.

Unlike Perl 6 junctions, they currently operate sequentially from their first child to their last.

As soon as any subpattern has matches, its result is returned.

Tree::Pattern::Any

Public methods

new(subpatterns :slurpy)

Creates a new Tree::Pattern::Any with the specified subpatterns.

ACCEPTSEXACTLY(tree)

Checks the tree for matching the pattern exactly.

Returns the result of the first subpattern that matches, otherwise a false Tree::Pattern::Match object.

close