line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
PPIx::Regexp::Token::GroupType::Modifier - Represent the modifiers in a modifier group. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use PPIx::Regexp::Dumper; |
8
|
|
|
|
|
|
|
PPIx::Regexp::Dumper->new( 'qr{(?i:foo)}smx' ) |
9
|
|
|
|
|
|
|
->print(); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 INHERITANCE |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
C is a |
14
|
|
|
|
|
|
|
L and a |
15
|
|
|
|
|
|
|
L. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
C has no descendants. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
This class represents the modifiers in a modifier group. The useful |
22
|
|
|
|
|
|
|
functionality comes from |
23
|
|
|
|
|
|
|
L. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 METHODS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
This class provides no public methods beyond those provided by its |
28
|
|
|
|
|
|
|
superclasses. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
package PPIx::Regexp::Token::GroupType::Modifier; |
33
|
|
|
|
|
|
|
|
34
|
9
|
|
|
9
|
|
61
|
use strict; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
259
|
|
35
|
9
|
|
|
9
|
|
51
|
use warnings; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
286
|
|
36
|
|
|
|
|
|
|
|
37
|
9
|
|
|
9
|
|
54
|
use base qw{ PPIx::Regexp::Token::Modifier PPIx::Regexp::Token::GroupType }; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
1039
|
|
38
|
|
|
|
|
|
|
|
39
|
9
|
|
|
9
|
|
59
|
use PPIx::Regexp::Constant qw{ MINIMUM_PERL @CARP_NOT }; |
|
9
|
|
|
|
|
32
|
|
|
9
|
|
|
|
|
3540
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
our $VERSION = '0.088'; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my %perl_version_introduced = ( |
46
|
|
|
|
|
|
|
'?:' => MINIMUM_PERL, |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub perl_version_introduced { |
50
|
9
|
|
|
9
|
1
|
2409
|
my ( $self ) = @_; |
51
|
9
|
|
|
|
|
45
|
my $content = $self->unescaped_content(); |
52
|
|
|
|
|
|
|
exists $perl_version_introduced{$content} |
53
|
9
|
100
|
|
|
|
32
|
and return $perl_version_introduced{$content}; |
54
|
8
|
|
|
|
|
33
|
my $ver = $self->SUPER::perl_version_introduced(); |
55
|
8
|
100
|
|
|
|
54
|
$ver > 5.005 and return $ver; |
56
|
2
|
|
|
|
|
6
|
return '5.005'; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=begin comment |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# Return true if the token can be quantified, and false otherwise |
64
|
|
|
|
|
|
|
# sub can_be_quantified { return }; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub __PPIX_TOKENIZER__regexp { |
67
|
|
|
|
|
|
|
my ( $class, $tokenizer, $character, $char_type ) = @_; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Note that the optional escapes are because any of the |
70
|
|
|
|
|
|
|
# non-open-bracket punctuation characters might be our delimiter. |
71
|
|
|
|
|
|
|
my $accept; |
72
|
|
|
|
|
|
|
$accept = $tokenizer->find_regexp( |
73
|
|
|
|
|
|
|
qr{ \A \\? [?] [[:lower:]]* \\? -? [[:lower:]]* \\? : }smx ) |
74
|
|
|
|
|
|
|
and return $accept; |
75
|
|
|
|
|
|
|
$accept = $tokenizer->find_regexp( |
76
|
|
|
|
|
|
|
qr{ \A \\? [?] \^ [[:lower:]]* \\? : }smx ) |
77
|
|
|
|
|
|
|
and return $accept; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
return; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=end comment |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub __make_group_type_matcher { |
87
|
|
|
|
|
|
|
return { |
88
|
13
|
|
|
13
|
|
371
|
'' => [ |
89
|
|
|
|
|
|
|
qr{ \A [?] [[:lower:]]* -? [[:lower:]]* : }smx, |
90
|
|
|
|
|
|
|
qr{ \A [?] \^ [[:lower:]]* : }smx, |
91
|
|
|
|
|
|
|
], |
92
|
|
|
|
|
|
|
'?' => [ |
93
|
|
|
|
|
|
|
qr{ \A \\ [?] [[:lower:]]* -? [[:lower:]]* : }smx, |
94
|
|
|
|
|
|
|
qr{ \A \\ [?] \^ [[:lower:]]* : }smx, |
95
|
|
|
|
|
|
|
], |
96
|
|
|
|
|
|
|
'-' => [ |
97
|
|
|
|
|
|
|
qr{ \A [?] [[:lower:]]* (?: \\ - )? [[:lower:]]* : }smx, |
98
|
|
|
|
|
|
|
qr{ \A [?] \^ [[:lower:]]* : }smx, |
99
|
|
|
|
|
|
|
], |
100
|
|
|
|
|
|
|
':' => [ |
101
|
|
|
|
|
|
|
qr{ \A [?] [[:lower:]]* -? [[:lower:]]* \\ : }smx, |
102
|
|
|
|
|
|
|
qr{ \A [?] \^ [[:lower:]]* \\ : }smx, |
103
|
|
|
|
|
|
|
], |
104
|
|
|
|
|
|
|
}; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
1; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
__END__ |