File Coverage

blib/lib/PPIx/Regexp/Token/GroupType/Switch.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             PPIx::Regexp::Token::GroupType::Switch - Represent the introducing characters for a switch
4              
5             =head1 SYNOPSIS
6              
7             use PPIx::Regexp::Dumper;
8             PPIx::Regexp::Dumper->new( 'qr{(?(1)foo|bar)}smx' )
9             ->print();
10              
11             =head1 INHERITANCE
12              
13             C is a
14             L.
15              
16             C has no descendants.
17              
18             =head1 DESCRIPTION
19              
20             This class represents the characters right after a left parenthesis that
21             introduce a switch. Strictly speaking these characters are '?(', but
22             this class only takes the '?'.
23              
24             =head1 METHODS
25              
26             This class provides no public methods beyond those provided by its
27             superclass.
28              
29             =cut
30              
31             package PPIx::Regexp::Token::GroupType::Switch;
32              
33 9     9   77 use strict;
  9         18  
  9         273  
34 9     9   46 use warnings;
  9         24  
  9         259  
35              
36 9     9   47 use base qw{ PPIx::Regexp::Token::GroupType };
  9         22  
  9         759  
37              
38 9     9   66 use PPIx::Regexp::Constant qw{ @CARP_NOT };
  9         21  
  9         1233  
39              
40             our $VERSION = '0.087_01';
41              
42             sub __match_setup {
43 32     32   121 my ( undef, $tokenizer ) = @_; # Invocant unused
44 32         131 $tokenizer->expect( qw{ PPIx::Regexp::Token::Condition } );
45 32         78 return;
46             }
47              
48 9         693 use constant DEF => {
49             '?' => {
50             expl => q,
51             intro => '5.005',
52             },
53 9     9   63 };
  9         22  
54              
55             __PACKAGE__->__setup_class(
56             {
57             suffix => '(',
58             },
59             );
60              
61             1;
62              
63             __END__