| 1 | =head1 NAME | ||
| 2 | |||
| 3 | PPIx::Regexp::Token::GroupType::Code - Represent one of the embedded code indicators | ||
| 4 | |||
| 5 | =head1 SYNOPSIS | ||
| 6 | |||
| 7 | use PPIx::Regexp::Dumper; | ||
| 8 | PPIx::Regexp::Dumper->new( 'qr{(?{print "hello world!\n")}smx' ) | ||
| 9 | ->print(); | ||
| 10 | |||
| 11 | =head1 INHERITANCE | ||
| 12 | |||
| 13 | C<PPIx::Regexp::Token::GroupType::Code> is a | ||
| 14 | L<PPIx::Regexp::Token::GroupType|PPIx::Regexp::Token::GroupType>. | ||
| 15 | |||
| 16 | C<PPIx::Regexp::Token::GroupType::Code> has no descendants. | ||
| 17 | |||
| 18 | =head1 DESCRIPTION | ||
| 19 | |||
| 20 | This method represents one of the embedded code indicators, either '?' | ||
| 21 | or '??', in the zero-width assertion | ||
| 22 | |||
| 23 | (?{ print "Hello, world!\n" }) | ||
| 24 | |||
| 25 | or the old-style deferred expression syntax | ||
| 26 | |||
| 27 | my $foo; | ||
| 28 | $foo = qr{ foo (??{ $foo }) }smx; | ||
| 29 | |||
| 30 | =head1 METHODS | ||
| 31 | |||
| 32 | This class provides no public methods beyond those provided by its | ||
| 33 | superclass. | ||
| 34 | |||
| 35 | =cut | ||
| 36 | |||
| 37 | package PPIx::Regexp::Token::GroupType::Code; | ||
| 38 | |||
| 39 | 9 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 40 | 9 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 41 | |||
| 42 | 9 | ▶ | use base qw{ PPIx::Regexp::Token::GroupType }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 43 | |||
| 44 | 9 | ▶ | use PPIx::Regexp::Constant qw{ @CARP_NOT }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | |||
| 46 | 9 | our $VERSION = '0.092'; | |
| 47 | |||
| 48 | 14 | ▶ | sub __match_setup { |
|
Subroutine
__match_setup: called CC=1 SCAR=0.0
| |||
| 49 | 14 | my ( undef, $tokenizer ) = @_; # Invocant unused | |
| 50 | 14 | $tokenizer->expect( qw{ PPIx::Regexp::Token::Code } ); | |
| 51 | 14 | return; | |
| 52 | } | ||
| 53 | |||
| 54 | 9 | ▶ | use constant DEF => { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 55 | '??' => { | ||
| 56 | expl => 'Evaluate code, use as regexp at this point', | ||
| 57 | intro => '5.006', | ||
| 58 | }, | ||
| 59 | '?p' => { | ||
| 60 | expl => 'Evaluate code, use as regexp at this point (removed in 5.9.5)', | ||
| 61 | intro => '5.005', # Presumed. I can find no documentation. | ||
| 62 | remov => '5.009005', | ||
| 63 | }, | ||
| 64 | '?' => { | ||
| 65 | expl => 'Evaluate code. Always matches.', | ||
| 66 | intro => '5.005', | ||
| 67 | }, | ||
| 68 | # Removed in 5.37.9. | ||
| 69 | # '**' => { | ||
| 70 | # expl => 'Evaluate code, use as regexp at this point. Optimized.', | ||
| 71 | # intro => '5.037008', | ||
| 72 | # }, | ||
| 73 | '*' => { | ||
| 74 | expl => 'Evaluate code. Always matches. Optimized.', | ||
| 75 | intro => '5.037008', | ||
| 76 | }, | ||
| 77 | 9 | }; | |
| 78 | |||
| 79 | 9 | __PACKAGE__->__setup_class( | |
| 80 | { | ||
| 81 | suffix => '{', | ||
| 82 | }, | ||
| 83 | ); | ||
| 84 | |||
| 85 | 9 | 1; | |
| 86 | |||
| 87 | __END__ | ||