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