line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::Declare::Parser::Sublike; |
2
|
3
|
|
|
3
|
|
44883
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
227
|
|
3
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
139
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
18
|
use base 'Devel::Declare::Parser'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
1704
|
|
6
|
3
|
|
|
3
|
|
17
|
use Devel::Declare::Interface; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
671
|
|
7
|
|
|
|
|
|
|
Devel::Declare::Interface::register_parser( 'sublike' ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub rewrite { |
10
|
20
|
|
|
20
|
1
|
24
|
my $self = shift; |
11
|
|
|
|
|
|
|
|
12
|
20
|
100
|
|
|
|
20
|
if ( @{ $self->parts } > 1 ) { |
|
20
|
|
|
|
|
47
|
|
13
|
2
|
|
|
|
|
4
|
( undef, my @bad ) = @{ $self->parts }; |
|
2
|
|
|
|
|
6
|
|
14
|
4
|
|
|
|
|
9
|
$self->bail( |
15
|
|
|
|
|
|
|
"Syntax error near: " . join( ' and ', |
16
|
2
|
|
|
|
|
5
|
map { $self->format_part($_)} @bad |
17
|
|
|
|
|
|
|
) |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
18
|
|
100
|
|
|
41
|
$self->new_parts([ $self->parts->[0] || 'undef' ]); |
22
|
18
|
|
|
|
|
48
|
1; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |