| 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 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | 9 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | |||
| 36 | 9 | ▶ | use base qw{ PPIx::Regexp::Token::GroupType }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 37 | |||
| 38 | 9 | ▶ | use PPIx::Regexp::Constant qw{ @CARP_NOT }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 39 | |||
| 40 | 9 | our $VERSION = '0.092'; | |
| 41 | |||
| 42 | 32 | ▶ | sub __match_setup { |
|
Subroutine
__match_setup: called CC=1 SCAR=0.0
| |||
| 43 | 32 | my ( undef, $tokenizer ) = @_; # Invocant unused | |
| 44 | 32 | $tokenizer->expect( qw{ PPIx::Regexp::Token::Condition } ); | |
| 45 | 32 | return; | |
| 46 | } | ||
| 47 | |||
| 48 | 9 | ▶ | use constant DEF => { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 49 | '?' => { | ||
| 50 | expl => q<Match one of the following '|'-delimited alternatives>, | ||
| 51 | intro => '5.005', | ||
| 52 | }, | ||
| 53 | 9 | }; | |
| 54 | |||
| 55 | 9 | __PACKAGE__->__setup_class( | |
| 56 | { | ||
| 57 | suffix => '(', | ||
| 58 | }, | ||
| 59 | ); | ||
| 60 | |||
| 61 | 9 | 1; | |
| 62 | |||
| 63 | __END__ | ||