line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MDOM::Rule::Simple; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
88
|
use strict; |
|
15
|
|
|
|
|
29
|
|
|
15
|
|
|
|
|
505
|
|
4
|
15
|
|
|
15
|
|
83
|
use warnings; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
383
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#use Smart::Comments; |
7
|
15
|
|
|
15
|
|
76
|
use base 'MDOM::Rule'; |
|
15
|
|
|
|
|
24
|
|
|
15
|
|
|
|
|
79
|
|
8
|
15
|
|
|
15
|
|
8244
|
use MDOM::Util qw( trim_tokens ); |
|
15
|
|
|
|
|
46
|
|
|
15
|
|
|
|
|
9673
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub targets { |
11
|
6
|
|
|
6
|
0
|
36
|
my ($self) = @_; |
12
|
6
|
100
|
|
|
|
26
|
$self->_parse if !$self->{colon}; |
13
|
6
|
|
|
|
|
10
|
my $tokens = $self->{targets}; |
14
|
6
|
100
|
|
|
|
27
|
wantarray ? @$tokens : $tokens; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub normal_prereqs { |
18
|
6
|
|
|
6
|
0
|
23
|
my ($self) = @_; |
19
|
6
|
50
|
|
|
|
18
|
$self->_parse if !$self->{colon}; |
20
|
6
|
|
|
|
|
12
|
my $tokens = $self->{normal_prereqs}; |
21
|
6
|
100
|
|
|
|
27
|
wantarray ? @$tokens : $tokens; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub order_prereqs { |
25
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
26
|
0
|
0
|
|
|
|
0
|
$self->_parse if !$self->{colon}; |
27
|
0
|
|
|
|
|
0
|
my $tokens = $self->{order_prereqs}; |
28
|
0
|
0
|
|
|
|
0
|
wantarray ? @$tokens : $tokens; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
sub colon { |
31
|
3
|
|
|
3
|
0
|
5
|
my ($self) = @_; |
32
|
3
|
50
|
|
|
|
12
|
$self->_parse if !$self->{colon}; |
33
|
3
|
|
|
|
|
16
|
$self->{colon}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub command { |
37
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
38
|
0
|
0
|
|
|
|
0
|
$self->_parse if !$self->{colon}; |
39
|
0
|
|
|
|
|
0
|
$self->{command}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _parse { |
43
|
3
|
|
|
3
|
|
5
|
my ($self) = @_; |
44
|
3
|
|
|
|
|
41
|
my @elems = $self->elements; |
45
|
3
|
|
|
|
|
6
|
my (@targets, $colon, @normal_prereqs, @order_prereqs, $command); |
46
|
3
|
|
|
|
|
6
|
my $prereqs = \@normal_prereqs; |
47
|
|
|
|
|
|
|
## @elems |
48
|
3
|
|
|
|
|
7
|
for my $elem (@elems) { |
49
|
34
|
100
|
66
|
|
|
121
|
if (!$colon) { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
50
|
12
|
100
|
|
|
|
46
|
if ($elem->class eq 'MDOM::Token::Separator') { |
51
|
3
|
|
|
|
|
12
|
$colon = $elem->content; |
52
|
|
|
|
|
|
|
} else { |
53
|
9
|
|
|
|
|
20
|
push @targets, $elem; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} elsif ($elem->class eq 'MDOM::Token::Comment') { |
56
|
1
|
|
|
|
|
2
|
last; |
57
|
|
|
|
|
|
|
} elsif ($elem->class eq 'MDOM::Command') { |
58
|
0
|
|
|
|
|
0
|
$command = $elem; |
59
|
0
|
|
|
|
|
0
|
last; |
60
|
|
|
|
|
|
|
} elsif ($elem->class eq 'MDOM::Token::Bare' and |
61
|
|
|
|
|
|
|
$elem->content eq '|') { |
62
|
0
|
|
|
|
|
0
|
$prereqs = \@order_prereqs; |
63
|
|
|
|
|
|
|
} else { |
64
|
21
|
|
|
|
|
48
|
push @$prereqs, $elem; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
3
|
|
|
|
|
13
|
trim_tokens(\@targets); |
68
|
3
|
|
|
|
|
9
|
trim_tokens(\@normal_prereqs); |
69
|
3
|
|
|
|
|
10
|
trim_tokens(\@order_prereqs); |
70
|
3
|
|
|
|
|
7
|
$self->{targets} = \@targets; |
71
|
3
|
|
|
|
|
7
|
$self->{colon} = $colon; |
72
|
3
|
|
|
|
|
12
|
$self->{normal_prereqs} = \@normal_prereqs; |
73
|
3
|
|
|
|
|
9
|
$self->{order_prereqs} = \@order_prereqs; |
74
|
3
|
|
|
|
|
10
|
$self->{command} = $command; |
75
|
|
|
|
|
|
|
### $self |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|