line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MDOM::Assignment; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
74
|
use strict; |
|
15
|
|
|
|
|
20
|
|
|
15
|
|
|
|
|
500
|
|
4
|
15
|
|
|
15
|
|
69
|
use warnings; |
|
15
|
|
|
|
|
22
|
|
|
15
|
|
|
|
|
405
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#use Smart::Comments; |
7
|
15
|
|
|
15
|
|
63
|
use base 'MDOM::Node'; |
|
15
|
|
|
|
|
24
|
|
|
15
|
|
|
|
|
71
|
|
8
|
15
|
|
|
15
|
|
82
|
use MDOM::Util qw( trim_tokens ); |
|
15
|
|
|
|
|
29
|
|
|
15
|
|
|
|
|
5463
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub lhs ($) { |
11
|
6
|
|
|
6
|
1
|
30
|
my ($self) = @_; |
12
|
6
|
100
|
|
|
|
21
|
$self->_parse if !defined $self->{op}; |
13
|
6
|
|
|
|
|
7
|
my $tokens = $self->{lhs}; |
14
|
6
|
100
|
|
|
|
27
|
wantarray ? @$tokens : $tokens; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub rhs ($) { |
18
|
6
|
|
|
6
|
1
|
18
|
my ($self) = @_; |
19
|
6
|
50
|
|
|
|
16
|
$self->_parse if !defined $self->{op}; |
20
|
6
|
|
|
|
|
8
|
my $tokens = $self->{rhs}; |
21
|
6
|
100
|
|
|
|
24
|
wantarray ? @$tokens : $tokens; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub op { |
25
|
3
|
|
|
3
|
1
|
4
|
my ($self) = @_; |
26
|
3
|
50
|
|
|
|
9
|
$self->_parse if !defined $self->{op}; |
27
|
3
|
|
|
|
|
10
|
$self->{op}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _parse ($) { |
31
|
3
|
|
|
3
|
|
3
|
my ($self) = @_; |
32
|
3
|
|
|
|
|
13
|
my @elems = $self->elements; |
33
|
|
|
|
|
|
|
### Assignment elems: @elems |
34
|
3
|
|
|
|
|
4
|
my (@lhs, @rhs, $op); |
35
|
3
|
|
|
|
|
6
|
for my $elem (@elems) { |
36
|
28
|
100
|
|
|
|
63
|
if (!$op) { |
|
|
100
|
|
|
|
|
|
37
|
11
|
100
|
|
|
|
27
|
if ($elem->class eq 'MDOM::Token::Separator') { |
38
|
3
|
|
|
|
|
6
|
$op = $elem; |
39
|
|
|
|
|
|
|
} else { |
40
|
8
|
|
|
|
|
40
|
push @lhs, $elem; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} elsif ($elem->class eq 'MDOM::Token::Comment') { |
43
|
1
|
|
|
|
|
3
|
last; |
44
|
|
|
|
|
|
|
} else { |
45
|
16
|
|
|
|
|
18
|
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
|
|
|
|
|
6
|
$self->{lhs} = \@lhs; |
52
|
3
|
|
|
|
|
6
|
$self->{rhs} = \@rhs; |
53
|
3
|
|
|
|
|
7
|
$self->{op} = $op; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |