line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
512
|
use 5.006; # our |
|
2
|
|
|
|
|
5
|
|
2
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
38
|
|
3
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
150
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package CPAN::Changes::Markdown::Filter::Rule::PackageNamesToCode; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Quote things that look like Perl Package names to Code |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.000002'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
458
|
use Moo qw( with ); |
|
2
|
|
|
|
|
9693
|
|
|
2
|
|
|
|
|
15
|
|
14
|
2
|
|
|
2
|
|
1619
|
use CPAN::Changes::Markdown::Filter::NodeUtil qw( mk_node_plaintext mk_node_delimitedtext ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
with 'CPAN::Changes::Markdown::Role::Filter::Rule::PlainText'; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $lc_package_chars = 'a-z0-9'; |
54
|
|
|
|
|
|
|
my $uc_package_chars = 'A-Z'; |
55
|
|
|
|
|
|
|
my $package_chars = $uc_package_chars . $lc_package_chars; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# _Pulp__5010_qr_m_propagate_properly |
58
|
|
|
|
|
|
|
## no critic (Compatibility::PerlMinimumVersionAndWhy) |
59
|
|
|
|
|
|
|
my $re_camelnoun = |
60
|
|
|
|
|
|
|
qr/(\A|\A.*?\s) ( [$uc_package_chars][$lc_package_chars]+(?: [$uc_package_chars][$package_chars]* )+ ) (\z|\s.*\z)/msx; |
61
|
|
|
|
|
|
|
my $re_prefix = qr/(\A|\A.*?\s) ( ::[$package_chars]+ (?: ::[$package_chars]+)* ) (\z|\s.*\z)/msx; |
62
|
|
|
|
|
|
|
my $re_suffix = qr/(\A|\A.*?\s) ( (?: [$package_chars]+:: )* [$package_chars]+:: ) (\z|\s.*\z)/msx; |
63
|
|
|
|
|
|
|
my $re_infix = qr/(\A|\A.*?\s) ( [$package_chars]+ (?: ::[$package_chars]+)+ ) (\z|\s.*\z)/msx; |
64
|
|
|
|
|
|
|
## use critic |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub _inject_code_delim { |
67
|
12
|
|
|
12
|
|
29
|
my ( $self, $out, $before, $code, $after ) = @_; |
68
|
12
|
|
|
|
|
11
|
push @{$out}, mk_node_plaintext($before); |
|
12
|
|
|
|
|
25
|
|
69
|
12
|
|
|
|
|
131
|
push @{$out}, mk_node_delimitedtext( q{`}, $code, q{`} ); |
|
12
|
|
|
|
|
37
|
|
70
|
12
|
|
|
|
|
949
|
push @{$out}, $self->filter_plaintext( mk_node_plaintext($after) ); |
|
12
|
|
|
|
|
24
|
|
71
|
12
|
|
|
|
|
10
|
return @{$out}; |
|
12
|
|
|
|
|
38
|
|
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub filter_plaintext { |
79
|
27
|
|
|
27
|
1
|
133
|
my ( $self, $input ) = @_; |
80
|
27
|
100
|
|
|
|
158
|
if ( $input->content =~ $re_camelnoun ) { |
81
|
4
|
|
|
|
|
9
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
82
|
|
|
|
|
|
|
} |
83
|
23
|
100
|
|
|
|
84
|
if ( $input->content =~ $re_prefix ) { |
84
|
3
|
|
|
|
|
8
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
85
|
|
|
|
|
|
|
} |
86
|
20
|
100
|
|
|
|
66
|
if ( $input->content =~ $re_suffix ) { |
87
|
2
|
|
|
|
|
6
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
88
|
|
|
|
|
|
|
} |
89
|
18
|
100
|
|
|
|
39
|
if ( $input->content =~ $re_infix ) { |
90
|
3
|
|
|
|
|
8
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
91
|
|
|
|
|
|
|
} |
92
|
15
|
|
|
|
|
23
|
return $input; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
__END__ |