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<PPIx::Regexp::Token::GroupType::Switch> is a
14             L<PPIx::Regexp::Token::GroupType|PPIx::Regexp::Token::GroupType>.
15              
16             C<PPIx::Regexp::Token::GroupType::Switch> 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   43 use strict;
  9         16  
  9         251  
34 9     9   36 use warnings;
  9         12  
  9         349  
35              
36 9     9   29 use base qw{ PPIx::Regexp::Token::GroupType };
  9         13  
  9         665  
37              
38 9     9   36 use PPIx::Regexp::Constant qw{ @CARP_NOT };
  9         23  
  9         1395  
39              
40             our $VERSION = '0.091';
41              
42             sub __match_setup {
43 32     32   84 my ( undef, $tokenizer ) = @_; # Invocant unused
44 32         113 $tokenizer->expect( qw{ PPIx::Regexp::Token::Condition } );
45 32         50 return;
46             }
47              
48 9         723 use constant DEF => {
49             '?' => {
50             expl => q<Match one of the following '|'-delimited alternatives>,
51             intro => '5.005',
52             },
53 9     9   47 };
  9         29  
54              
55             __PACKAGE__->__setup_class(
56             {
57             suffix => '(',
58             },
59             );
60              
61             1;
62              
63             __END__
64              
65             =head1 SUPPORT
66              
67             Support is by the author. Please file bug reports at
68             L<https://rt.cpan.org/Public/Dist/Display.html?Name=PPIx-Regexp>,
69             L<https://github.com/trwyant/perl-PPIx-Regexp/issues>, or in
70             electronic mail to the author.
71              
72             =head1 AUTHOR
73              
74             Thomas R. Wyant, III F<wyant at cpan dot org>
75              
76             =head1 COPYRIGHT AND LICENSE
77              
78             Copyright (C) 2009-2023, 2025 by Thomas R. Wyant, III
79              
80             This program is free software; you can redistribute it and/or modify it
81             under the same terms as Perl 5.10.0. For more details, see the full text
82             of the licenses in the directory LICENSES.
83              
84             This program is distributed in the hope that it will be useful, but
85             without any warranty; without even the implied warranty of
86             merchantability or fitness for a particular purpose.
87              
88             =cut
89              
90             # ex: set textwidth=72 :