line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
1057
|
use 5.008; # utf8 |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
78
|
|
2
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
71
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
57
|
|
4
|
2
|
|
|
2
|
|
758
|
use utf8; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
15
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package CPAN::Changes::Markdown::Filter::Rule::PackageNamesToCode; |
7
|
|
|
|
|
|
|
$CPAN::Changes::Markdown::Filter::Rule::PackageNamesToCode::VERSION = '1.000000'; |
8
|
|
|
|
|
|
|
# ABSTRACT: Quote things that look like Perl Package names to Code |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
933
|
use Moo qw( with ); |
|
2
|
|
|
|
|
16054
|
|
|
2
|
|
|
|
|
16
|
|
13
|
2
|
|
|
2
|
|
2507
|
use CPAN::Changes::Markdown::Filter::NodeUtil qw( mk_node_plaintext mk_node_delimitedtext ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
17
|
|
14
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
with 'CPAN::Changes::Markdown::Role::Filter::Rule::PlainText'; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $lc_package_chars = 'a-z0-9'; |
53
|
|
|
|
|
|
|
my $uc_package_chars = 'A-Z'; |
54
|
|
|
|
|
|
|
my $package_chars = $uc_package_chars . $lc_package_chars; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# _Pulp__5010_qr_m_propagate_properly |
57
|
|
|
|
|
|
|
## no critic (Compatibility::PerlMinimumVersionAndWhy) |
58
|
|
|
|
|
|
|
my $re_camelnoun = |
59
|
|
|
|
|
|
|
qr/(\A|\A.*?\s) ( [$uc_package_chars][$lc_package_chars]+(?: [$uc_package_chars][$package_chars]* )+ ) (\z|\s.*\z)/msx; |
60
|
|
|
|
|
|
|
my $re_prefix = qr/(\A|\A.*?\s) ( ::[$package_chars]+ (?: ::[$package_chars]+)* ) (\z|\s.*\z)/msx; |
61
|
|
|
|
|
|
|
my $re_suffix = qr/(\A|\A.*?\s) ( (?: [$package_chars]+:: )* [$package_chars]+:: ) (\z|\s.*\z)/msx; |
62
|
|
|
|
|
|
|
my $re_infix = qr/(\A|\A.*?\s) ( [$package_chars]+ (?: ::[$package_chars]+)+ ) (\z|\s.*\z)/msx; |
63
|
|
|
|
|
|
|
## use critic |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub _inject_code_delim { |
66
|
12
|
|
|
12
|
|
36
|
my ( $self, $out, $before, $code, $after ) = @_; |
67
|
12
|
|
|
|
|
14
|
push @{$out}, mk_node_plaintext($before); |
|
12
|
|
|
|
|
35
|
|
68
|
12
|
|
|
|
|
234
|
push @{$out}, mk_node_delimitedtext( q{`}, $code, q{`} ); |
|
12
|
|
|
|
|
37
|
|
69
|
12
|
|
|
|
|
1524
|
push @{$out}, $self->filter_plaintext( mk_node_plaintext($after) ); |
|
12
|
|
|
|
|
32
|
|
70
|
12
|
|
|
|
|
19
|
return @{$out}; |
|
12
|
|
|
|
|
69
|
|
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub filter_plaintext { |
78
|
27
|
|
|
27
|
1
|
247
|
my ( $self, $input ) = @_; |
79
|
27
|
100
|
|
|
|
224
|
if ( $input->content =~ $re_camelnoun ) { |
80
|
4
|
|
|
|
|
14
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
81
|
|
|
|
|
|
|
} |
82
|
23
|
100
|
|
|
|
127
|
if ( $input->content =~ $re_prefix ) { |
83
|
3
|
|
|
|
|
12
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
84
|
|
|
|
|
|
|
} |
85
|
20
|
100
|
|
|
|
120
|
if ( $input->content =~ $re_suffix ) { |
86
|
2
|
|
|
|
|
7
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
87
|
|
|
|
|
|
|
} |
88
|
18
|
100
|
|
|
|
69
|
if ( $input->content =~ $re_infix ) { |
89
|
3
|
|
|
|
|
8
|
return $self->_inject_code_delim( [], $1, $2, $3 ); |
90
|
|
|
|
|
|
|
} |
91
|
15
|
|
|
|
|
36
|
return $input; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |