line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PPI::Token::ArrayIndex; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
PPI::Token::ArrayIndex - Token getting the last index for an array |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 INHERITANCE |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
PPI::Token::ArrayIndex |
12
|
|
|
|
|
|
|
isa PPI::Token |
13
|
|
|
|
|
|
|
isa PPI::Element |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
The C token represents an attempt to get the |
18
|
|
|
|
|
|
|
last index of an array, such as C<$#array>. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 METHODS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
There are no additional methods beyond those provided by the parent |
23
|
|
|
|
|
|
|
L and L classes. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
65
|
|
|
65
|
|
370
|
use strict; |
|
65
|
|
|
|
|
115
|
|
|
65
|
|
|
|
|
1491
|
|
28
|
65
|
|
|
65
|
|
275
|
use PPI::Token (); |
|
65
|
|
|
|
|
107
|
|
|
65
|
|
|
|
|
12348
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our $VERSION = '1.276'; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
our @ISA = "PPI::Token"; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
##################################################################### |
39
|
|
|
|
|
|
|
# Tokenizer Methods |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub __TOKENIZER__on_char { |
42
|
98
|
|
|
98
|
|
137
|
my $t = $_[1]; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# Suck in till the end of the arrayindex |
45
|
98
|
|
|
|
|
266
|
pos $t->{line} = $t->{line_cursor}; |
46
|
98
|
50
|
|
|
|
382
|
if ( $t->{line} =~ m/\G([\w:']+)/gc ) { |
47
|
98
|
|
|
|
|
509
|
$t->{token}->{content} .= $1; |
48
|
98
|
|
|
|
|
203
|
$t->{line_cursor} += length $1; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# End of token |
52
|
98
|
|
|
|
|
246
|
$t->_finalize_token->__TOKENIZER__on_char( $t ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=pod |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 SUPPORT |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
See the L in the main module. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 AUTHOR |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Adam Kennedy Eadamk@cpan.orgE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 COPYRIGHT |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Copyright 2001 - 2011 Adam Kennedy. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This program is free software; you can redistribute |
72
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
The full text of the license can be found in the |
75
|
|
|
|
|
|
|
LICENSE file included with this module. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |