line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MDOM::Rule::Simple; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
64
|
use strict; |
|
15
|
|
|
|
|
19
|
|
|
15
|
|
|
|
|
421
|
|
4
|
15
|
|
|
15
|
|
59
|
use warnings; |
|
15
|
|
|
|
|
18
|
|
|
15
|
|
|
|
|
306
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#use Smart::Comments; |
7
|
15
|
|
|
15
|
|
49
|
use base 'MDOM::Rule'; |
|
15
|
|
|
|
|
19
|
|
|
15
|
|
|
|
|
58
|
|
8
|
15
|
|
|
15
|
|
4978
|
use MDOM::Util qw( trim_tokens ); |
|
15
|
|
|
|
|
31
|
|
|
15
|
|
|
|
|
5439
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub targets { |
11
|
6
|
|
|
6
|
1
|
27
|
my ($self) = @_; |
12
|
6
|
100
|
|
|
|
18
|
$self->_parse if !$self->{colon}; |
13
|
6
|
|
|
|
|
7
|
my $tokens = $self->{targets}; |
14
|
6
|
100
|
|
|
|
22
|
wantarray ? @$tokens : $tokens; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub normal_prereqs { |
18
|
6
|
|
|
6
|
1
|
22
|
my ($self) = @_; |
19
|
6
|
50
|
|
|
|
16
|
$self->_parse if !$self->{colon}; |
20
|
6
|
|
|
|
|
7
|
my $tokens = $self->{normal_prereqs}; |
21
|
6
|
100
|
|
|
|
23
|
wantarray ? @$tokens : $tokens; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub order_prereqs { |
25
|
0
|
|
|
0
|
1
|
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
|
1
|
4
|
my ($self) = @_; |
32
|
3
|
50
|
|
|
|
9
|
$self->_parse if !$self->{colon}; |
33
|
3
|
|
|
|
|
8
|
$self->{colon}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub command { |
37
|
0
|
|
|
0
|
1
|
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
|
|
3
|
my ($self) = @_; |
44
|
3
|
|
|
|
|
12
|
my @elems = $self->elements; |
45
|
3
|
|
|
|
|
5
|
my (@targets, $colon, @normal_prereqs, @order_prereqs, $command); |
46
|
3
|
|
|
|
|
4
|
my $prereqs = \@normal_prereqs; |
47
|
|
|
|
|
|
|
## @elems |
48
|
3
|
|
|
|
|
5
|
for my $elem (@elems) { |
49
|
34
|
100
|
66
|
|
|
65
|
if (!$colon) { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
50
|
12
|
100
|
|
|
|
31
|
if ($elem->class eq 'MDOM::Token::Separator') { |
51
|
3
|
|
|
|
|
7
|
$colon = $elem->content; |
52
|
|
|
|
|
|
|
} else { |
53
|
9
|
|
|
|
|
10
|
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
|
|
|
|
|
25
|
push @$prereqs, $elem; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
3
|
|
|
|
|
9
|
trim_tokens(\@targets); |
68
|
3
|
|
|
|
|
7
|
trim_tokens(\@normal_prereqs); |
69
|
3
|
|
|
|
|
6
|
trim_tokens(\@order_prereqs); |
70
|
3
|
|
|
|
|
7
|
$self->{targets} = \@targets; |
71
|
3
|
|
|
|
|
4
|
$self->{colon} = $colon; |
72
|
3
|
|
|
|
|
5
|
$self->{normal_prereqs} = \@normal_prereqs; |
73
|
3
|
|
|
|
|
4
|
$self->{order_prereqs} = \@order_prereqs; |
74
|
3
|
|
|
|
|
6
|
$self->{command} = $command; |
75
|
|
|
|
|
|
|
### $self |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__END__ |