| 1 | package TPath::Selector::Expression; | ||
| 2 | $TPath::Selector::Expression::VERSION = '1.007'; | ||
| 3 | # ABSTRACT: selector that handles the parenthesized portion of C<a(/foo|/bar)> and C<a(/foo|/bar)+>; also all of C<(//*)[0]> | ||
| 4 | |||
| 5 | |||
| 6 | 1 | ▶ | use v5.10; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 0 | ▶ | use TPath::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 10 | use namespace::autoclean; | ||
| 11 | |||
| 12 | |||
| 13 | with 'TPath::Selector::Predicated'; | ||
| 14 | |||
| 15 | |||
| 16 | has e => ( is => 'ro', isa => 'TPath::Expression', required => 1 ); | ||
| 17 | |||
| 18 | sub select { | ||
| 19 | my ( $self, $ctx, $first ) = @_; | ||
| 20 | return $self->apply_predicates( @{ $self->e->_select( $ctx, $first ) } ); | ||
| 21 | } | ||
| 22 | |||
| 23 | sub to_string { | ||
| 24 | my $self = shift; | ||
| 25 | return '(' . $self->e->to_string . ')'; | ||
| 26 | } | ||
| 27 | |||
| 28 | __PACKAGE__->meta->make_immutable; | ||
| 29 | |||
| 30 | 1; | ||
| 31 | |||
| 32 | __END__ | ||