Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / PPI / Token / ArrayIndex.pm
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<PPI::Token::ArrayIndex> 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<PPI::Token> and L<PPI::Element> classes.
24
25 Got any ideas for methods? Submit a report to rt.cpan.org!
26
27 =cut
28
29 use strict;
30 use PPI::Token ();
31
32 use vars qw{$VERSION @ISA};
33 BEGIN {
34         $VERSION = '1.206';
35         @ISA     = 'PPI::Token';
36 }
37
38
39
40
41
42 #####################################################################
43 # Tokenizer Methods
44
45 sub __TOKENIZER__on_char {
46         my $t = $_[1];
47
48         # Suck in till the end of the arrayindex
49         my $line = substr( $t->{line}, $t->{line_cursor} );
50         if ( $line =~ /^([\w:']+)/ ) {
51                 $t->{token}->{content} .= $1;
52                 $t->{line_cursor} += length $1;
53         }
54
55         # End of token
56         $t->_finalize_token->__TOKENIZER__on_char( $t );
57 }
58
59 1;
60
61 =pod
62
63 =head1 SUPPORT
64
65 See the L<support section|PPI/SUPPORT> in the main module.
66
67 =head1 AUTHOR
68
69 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
70
71 =head1 COPYRIGHT
72
73 Copyright 2001 - 2009 Adam Kennedy.
74
75 This program is free software; you can redistribute
76 it and/or modify it under the same terms as Perl itself.
77
78 The full text of the license can be found in the
79 LICENSE file included with this module.
80
81 =cut