Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / PPI / Token / End.pm
1 package PPI::Token::End;
2
3 =pod
4
5 =head1 NAME
6
7 PPI::Token::End - Completely useless content after the __END__ tag
8
9 =head1 INHERITANCE
10
11   PPI::Token::End
12   isa PPI::Token
13           isa PPI::Element
14
15 =head1 DESCRIPTION
16
17 If you've read L<PPI::Token::Whitespace>, you should understand by now
18 the concept of documents "floating in a sea of PPI::Token::Whitespace".
19
20 Well it doesn't after the __END__ tag.
21
22 Once you __END__, it's all over. Anything after that tag isn't even fit
23 to be called whitespace. It just simply doesn't exist as far as perl
24 (the interpreter) is concerned.
25
26 That's not to say there isn't useful content. Most often people use
27 the __END__ tag to hide POD content, so that perl never has to see it,
28 and presumably providing some small speed up.
29
30 That's fine. PPI likes POD. Any POD after the __END__ tag is parsed
31 into valid L<PPI::Token::Pod> tags as normal. B<This> class, on the
32 other hand, is for "what's after __END__ when it isn't POD". 
33
34 Basically, the completely worthless bits of the file :)
35
36 =head1 METHODS
37
38 This class has no method beyond what is provided by its L<PPI::Token> and
39 L<PPI::Element> parent classes.
40
41 =cut
42
43 use strict;
44 use PPI::Token ();
45
46 use vars qw{$VERSION @ISA};
47 BEGIN {
48         $VERSION = '1.206';
49         @ISA     = 'PPI::Token';
50 }
51
52
53
54
55
56 #####################################################################
57 # Tokenizer Methods
58
59 ### XS -> PPI/XS.xs:_PPI_Token_End__significant 0.900+
60 sub significant { '' }
61
62 sub __TOKENIZER__on_char { 1 }
63
64 sub __TOKENIZER__on_line_start {
65         my $t = $_[1];
66
67         # Can we classify the entire line in one go
68         if ( $t->{line} =~ /^=(\w+)/ ) {
69                 # A Pod tag... change to pod mode
70                 $t->_new_token( 'Pod', $t->{line} );
71                 unless ( $1 eq 'cut' ) {
72                         # Normal start to pod
73                         $t->{class} = 'PPI::Token::Pod';
74                 }
75
76                 # This is an error, but one we'll ignore
77                 # Don't go into Pod mode, since =cut normally
78                 # signals the end of Pod mode
79         } else {
80                 if ( defined $t->{token} ) {
81                         # Add to existing token
82                         $t->{token}->{content} .= $t->{line};
83                 } else {
84                         $t->_new_token( 'End', $t->{line} );
85                 }
86         }
87
88         0;
89 }
90
91 1;
92
93 =pod
94
95 =head1 SUPPORT
96
97 See the L<support section|PPI/SUPPORT> in the main module.
98
99 =head1 AUTHOR
100
101 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
102
103 =head1 COPYRIGHT
104
105 Copyright 2001 - 2009 Adam Kennedy.
106
107 This program is free software; you can redistribute
108 it and/or modify it under the same terms as Perl itself.
109
110 The full text of the license can be found in the
111 LICENSE file included with this module.
112
113 =cut