TPath/Selector/Expression.pm

filter: Statementstmt 75.0% 6 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 81.8% 9 / 11 CC 1 SCAR 0.9
CC
1
Cov
75%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« TPath/TypeConstraints.pm ↑ Summary TPath/Selector/Predicated.pm »
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__
« TPath/TypeConstraints.pm ↑ Summary TPath/Selector/Predicated.pm »