line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MDOM::Assignment; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
63
|
use strict; |
|
15
|
|
|
|
|
20
|
|
|
15
|
|
|
|
|
444
|
|
4
|
15
|
|
|
15
|
|
60
|
use warnings; |
|
15
|
|
|
|
|
20
|
|
|
15
|
|
|
|
|
418
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#use Smart::Comments; |
7
|
15
|
|
|
15
|
|
57
|
use base 'MDOM::Node'; |
|
15
|
|
|
|
|
19
|
|
|
15
|
|
|
|
|
67
|
|
8
|
15
|
|
|
15
|
|
76
|
use MDOM::Util qw( trim_tokens ); |
|
15
|
|
|
|
|
26
|
|
|
15
|
|
|
|
|
4753
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub lhs ($) { |
11
|
6
|
|
|
6
|
1
|
28
|
my ($self) = @_; |
12
|
6
|
100
|
|
|
|
23
|
$self->_parse if !defined $self->{op}; |
13
|
6
|
|
|
|
|
9
|
my $tokens = $self->{lhs}; |
14
|
6
|
100
|
|
|
|
25
|
wantarray ? @$tokens : $tokens; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub rhs ($) { |
18
|
6
|
|
|
6
|
1
|
23
|
my ($self) = @_; |
19
|
6
|
50
|
|
|
|
17
|
$self->_parse if !defined $self->{op}; |
20
|
6
|
|
|
|
|
8
|
my $tokens = $self->{rhs}; |
21
|
6
|
100
|
|
|
|
31
|
wantarray ? @$tokens : $tokens; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub op { |
25
|
3
|
|
|
3
|
1
|
5
|
my ($self) = @_; |
26
|
3
|
50
|
|
|
|
12
|
$self->_parse if !defined $self->{op}; |
27
|
3
|
|
|
|
|
11
|
$self->{op}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _parse ($) { |
31
|
3
|
|
|
3
|
|
3
|
my ($self) = @_; |
32
|
3
|
|
|
|
|
16
|
my @elems = $self->elements; |
33
|
|
|
|
|
|
|
### Assignment elems: @elems |
34
|
3
|
|
|
|
|
5
|
my (@lhs, @rhs, $op); |
35
|
3
|
|
|
|
|
6
|
for my $elem (@elems) { |
36
|
28
|
100
|
|
|
|
65
|
if (!$op) { |
|
|
100
|
|
|
|
|
|
37
|
11
|
100
|
|
|
|
32
|
if ($elem->class eq 'MDOM::Token::Separator') { |
38
|
3
|
|
|
|
|
5
|
$op = $elem; |
39
|
|
|
|
|
|
|
} else { |
40
|
8
|
|
|
|
|
15
|
push @lhs, $elem; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} elsif ($elem->class eq 'MDOM::Token::Comment') { |
43
|
1
|
|
|
|
|
2
|
last; |
44
|
|
|
|
|
|
|
} else { |
45
|
16
|
|
|
|
|
23
|
push @rhs, $elem; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
3
|
|
|
|
|
13
|
trim_tokens(\@lhs); |
49
|
3
|
100
|
|
|
|
8
|
pop @rhs if $rhs[-1] eq "\n"; |
50
|
3
|
100
|
|
|
|
10
|
shift @rhs if $rhs[0]->class eq 'MDOM::Token::Whitespace'; |
51
|
3
|
|
|
|
|
7
|
$self->{lhs} = \@lhs; |
52
|
3
|
|
|
|
|
4
|
$self->{rhs} = \@rhs; |
53
|
3
|
|
|
|
|
8
|
$self->{op} = $op; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |