| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
=head1 NAME |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
PPIx::Regexp::Token::Whitespace - Represent whitespace |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use PPIx::Regexp::Dumper; |
|
8
|
|
|
|
|
|
|
PPIx::Regexp::Dumper->new( 'qr{ foo }smx' ) |
|
9
|
|
|
|
|
|
|
->print(); |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 INHERITANCE |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
C<PPIx::Regexp::Token::Whitespace> is a |
|
14
|
|
|
|
|
|
|
L<PPIx::Regexp::Token::NoOp|PPIx::Regexp::Token::NoOp>. |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
C<PPIx::Regexp::Token::Whitespace> has no descendants. |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This class represents whitespace. It will appear inside the regular |
|
21
|
|
|
|
|
|
|
expression only if the C</x> modifier is present, but it may also appear |
|
22
|
|
|
|
|
|
|
between the type and the opening delimiter (e.g. C<qr {foo}>) or after |
|
23
|
|
|
|
|
|
|
the regular expression in a bracketed substitution (e.g. C<s{foo} |
|
24
|
|
|
|
|
|
|
{bar}>). |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
If the C</xx> modifier is present, it can also appear inside bracketed |
|
27
|
|
|
|
|
|
|
character classes. This was introduced in Perl 5.25.9. |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 METHODS |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
This class provides no public methods beyond those provided by its |
|
32
|
|
|
|
|
|
|
superclass. |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
package PPIx::Regexp::Token::Whitespace; |
|
37
|
|
|
|
|
|
|
|
|
38
|
9
|
|
|
9
|
|
41
|
use strict; |
|
|
9
|
|
|
|
|
15
|
|
|
|
9
|
|
|
|
|
258
|
|
|
39
|
9
|
|
|
9
|
|
30
|
use warnings; |
|
|
9
|
|
|
|
|
21
|
|
|
|
9
|
|
|
|
|
388
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
9
|
|
|
9
|
|
45
|
use base qw{ PPIx::Regexp::Token::NoOp }; |
|
|
9
|
|
|
|
|
21
|
|
|
|
9
|
|
|
|
|
3546
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
9
|
|
|
|
|
2596
|
use PPIx::Regexp::Constant qw{ |
|
44
|
|
|
|
|
|
|
COOKIE_REGEX_SET |
|
45
|
|
|
|
|
|
|
MINIMUM_PERL |
|
46
|
|
|
|
|
|
|
@CARP_NOT |
|
47
|
9
|
|
|
9
|
|
45
|
}; |
|
|
9
|
|
|
|
|
22
|
|
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
our $VERSION = '0.091'; |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub __new { |
|
52
|
151
|
|
|
151
|
|
370
|
my ( $class, $content, %arg ) = @_; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
defined $arg{perl_version_introduced} |
|
55
|
|
|
|
|
|
|
or $arg{perl_version_introduced} = |
|
56
|
151
|
100
|
|
|
|
853
|
( grep { 127 < ord } split qr{}, $content ) |
|
|
157
|
100
|
|
|
|
549
|
|
|
57
|
|
|
|
|
|
|
? '5.021001' |
|
58
|
|
|
|
|
|
|
: MINIMUM_PERL; |
|
59
|
|
|
|
|
|
|
|
|
60
|
151
|
|
|
|
|
684
|
return $class->SUPER::__new( $content, %arg ); |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub explain { |
|
64
|
3
|
|
|
3
|
1
|
6
|
my ( $self ) = @_; |
|
65
|
3
|
|
|
|
|
5
|
my $parent; |
|
66
|
3
|
100
|
66
|
|
|
12
|
if ( |
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
$parent = $self->parent() |
|
68
|
|
|
|
|
|
|
and $parent->isa( 'PPIx::Regexp' ) |
|
69
|
|
|
|
|
|
|
) { |
|
70
|
1
|
|
|
|
|
8
|
return $self->SUPER::explain(); |
|
71
|
|
|
|
|
|
|
} elsif ( $self->in_regex_set() ) { |
|
72
|
1
|
|
|
|
|
3
|
return q<Not significant in extended character class>; |
|
73
|
|
|
|
|
|
|
} elsif ( my $count = $self->modifier_asserted( 'x*' ) ) { |
|
74
|
1
|
|
|
|
|
5
|
return q<Not significant under /> . ( 'x' x $count ); |
|
75
|
|
|
|
|
|
|
} else { |
|
76
|
0
|
|
|
|
|
0
|
return $self->SUPER::explain(); |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub whitespace { |
|
81
|
1
|
|
|
1
|
1
|
3
|
return 1; |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
# Objects of this class are generated either by the tokenizer itself |
|
85
|
|
|
|
|
|
|
# (when scanning for delimiters) or by PPIx::Regexp::Token::Literal (if |
|
86
|
|
|
|
|
|
|
# it hits a match for \s and finds the regular expression has the /x |
|
87
|
|
|
|
|
|
|
# modifier asserted. |
|
88
|
|
|
|
|
|
|
# |
|
89
|
|
|
|
|
|
|
# sub __PPIX_TOKENIZER__regexp { |
|
90
|
|
|
|
|
|
|
# my ( $class, $tokenizer, $character ) = @_; |
|
91
|
|
|
|
|
|
|
# |
|
92
|
|
|
|
|
|
|
# return scalar $tokenizer->find_regexp( qr{ \A \s+ }smx ); |
|
93
|
|
|
|
|
|
|
# |
|
94
|
|
|
|
|
|
|
# } |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
__END__ |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SUPPORT |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Support is by the author. Please file bug reports at |
|
103
|
|
|
|
|
|
|
L<https://rt.cpan.org/Public/Dist/Display.html?Name=PPIx-Regexp>, |
|
104
|
|
|
|
|
|
|
L<https://github.com/trwyant/perl-PPIx-Regexp/issues>, or in |
|
105
|
|
|
|
|
|
|
electronic mail to the author. |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 AUTHOR |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Thomas R. Wyant, III F<wyant at cpan dot org> |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Copyright (C) 2009-2023, 2025 by Thomas R. Wyant, III |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
116
|
|
|
|
|
|
|
under the same terms as Perl 5.10.0. For more details, see the full text |
|
117
|
|
|
|
|
|
|
of the licenses in the directory LICENSES. |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but |
|
120
|
|
|
|
|
|
|
without any warranty; without even the implied warranty of |
|
121
|
|
|
|
|
|
|
merchantability or fitness for a particular purpose. |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
# ex: set textwidth=72 : |