1 package PPI::Token::End;
7 PPI::Token::End - Completely useless content after the __END__ tag
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".
20 Well it doesn't after the __END__ tag.
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.
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.
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".
34 Basically, the completely worthless bits of the file :)
38 This class has no method beyond what is provided by its L<PPI::Token> and
39 L<PPI::Element> parent classes.
46 use vars qw{$VERSION @ISA};
56 #####################################################################
59 ### XS -> PPI/XS.xs:_PPI_Token_End__significant 0.900+
60 sub significant { '' }
62 sub __TOKENIZER__on_char { 1 }
64 sub __TOKENIZER__on_line_start {
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' ) {
73 $t->{class} = 'PPI::Token::Pod';
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
80 if ( defined $t->{token} ) {
81 # Add to existing token
82 $t->{token}->{content} .= $t->{line};
84 $t->_new_token( 'End', $t->{line} );
97 See the L<support section|PPI/SUPPORT> in the main module.
101 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
105 Copyright 2001 - 2009 Adam Kennedy.
107 This program is free software; you can redistribute
108 it and/or modify it under the same terms as Perl itself.
110 The full text of the license can be found in the
111 LICENSE file included with this module.