File Coverage

blib/lib/PPIx/Regexp/Token/GroupType/Code.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::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     9   46 use strict;
  9         20  
  9         296  
40 9     9   34 use warnings;
  9         15  
  9         372  
41              
42 9     9   40 use base qw{ PPIx::Regexp::Token::GroupType };
  9         15  
  9         856  
43              
44 9     9   49 use PPIx::Regexp::Constant qw{ @CARP_NOT };
  9         256  
  9         1616  
45              
46             our $VERSION = '0.091';
47              
48             sub __match_setup {
49 14     14   34 my ( undef, $tokenizer ) = @_; # Invocant unused
50 14         42 $tokenizer->expect( qw{ PPIx::Regexp::Token::Code } );
51 14         21 return;
52             }
53              
54 9         824 use constant DEF => {
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     9   77 };
  9         15  
78              
79             __PACKAGE__->__setup_class(
80             {
81             suffix => '{',
82             },
83             );
84              
85             1;
86              
87             __END__
88              
89             =head1 SUPPORT
90              
91             Support is by the author. Please file bug reports at
92             L<https://rt.cpan.org/Public/Dist/Display.html?Name=PPIx-Regexp>,
93             L<https://github.com/trwyant/perl-PPIx-Regexp/issues>, or in
94             electronic mail to the author.
95              
96             =head1 AUTHOR
97              
98             Thomas R. Wyant, III F<wyant at cpan dot org>
99              
100             =head1 COPYRIGHT AND LICENSE
101              
102             Copyright (C) 2009-2023, 2025 by Thomas R. Wyant, III
103              
104             This program is free software; you can redistribute it and/or modify it
105             under the same terms as Perl 5.10.0. For more details, see the full text
106             of the licenses in the directory LICENSES.
107              
108             This program is distributed in the hope that it will be useful, but
109             without any warranty; without even the implied warranty of
110             merchantability or fitness for a particular purpose.
111              
112             =cut
113              
114             # ex: set textwidth=72 :