line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
761
|
use 5.006; # our |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
71
|
|
2
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
66
|
|
3
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
144
|
|
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.000001'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
467
|
use Moo qw( with ); |
|
2
|
|
|
|
|
10839
|
|
|
2
|
|
|
|
|
13
|
|
14
|
2
|
|
|
2
|
|
1797
|
use CPAN::Changes::Markdown::Filter::NodeUtil qw( mk_node_plaintext mk_node_delimitedtext ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
15
|
|
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
|
|
28
|
my ( $self, $out, $before, $code, $after ) = @_; |
68
|
12
|
|
|
|
|
11
|
push @{$out}, mk_node_plaintext($before); |
|
12
|
|
|
|
|
30
|
|
69
|
12
|
|
|
|
|
180
|
push @{$out}, mk_node_delimitedtext( q{`}, $code, q{`} ); |
|
12
|
|
|
|
|
30
|
|
70
|
12
|
|
|
|
|
1260
|
push @{$out}, $self->filter_plaintext( mk_node_plaintext($after) ); |
|
12
|
|
|
|
|
29
|
|
71
|
12
|
|
|
|
|
13
|
return @{$out}; |
|
12
|
|
|
|
|
55
|
|
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub filter_plaintext { |
79
|
27
|
|
|
27
|
1
|
196
|
my ( $self, $input ) = @_; |
80
|
27
|
100
|
|
|
|
211
|
if ( $input->content =~ $re_camelnoun ) { |
81
|
4
|
|
|
|
|
13
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
82
|
|
|
|
|
|
|
} |
83
|
23
|
100
|
|
|
|
92
|
if ( $input->content =~ $re_prefix ) { |
84
|
3
|
|
|
|
|
9
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
85
|
|
|
|
|
|
|
} |
86
|
20
|
100
|
|
|
|
77
|
if ( $input->content =~ $re_suffix ) { |
87
|
2
|
|
|
|
|
7
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
88
|
|
|
|
|
|
|
} |
89
|
18
|
100
|
|
|
|
51
|
if ( $input->content =~ $re_infix ) { |
90
|
3
|
|
|
|
|
10
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
91
|
|
|
|
|
|
|
} |
92
|
15
|
|
|
|
|
32
|
return $input; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
__END__ |