Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Pod / Simple / PullParserEndToken.pm
CommitLineData
3fea05b9 1
2require 5;
3package Pod::Simple::PullParserEndToken;
4use Pod::Simple::PullParserToken ();
5@ISA = ('Pod::Simple::PullParserToken');
6use strict;
7
8sub new { # Class->new(tagname);
9 my $class = shift;
10 return bless ['end', @_], ref($class) || $class;
11}
12
13# Purely accessors:
14
15sub tagname { (@_ == 2) ? ($_[0][1] = $_[1]) : $_[0][1] }
16sub tag { shift->tagname(@_) }
17
18# shortcut:
19sub is_tagname { $_[0][1] eq $_[1] }
20sub is_tag { shift->is_tagname(@_) }
21
221;
23
24
25__END__
26
27=head1 NAME
28
29Pod::Simple::PullParserEndToken -- end-tokens from Pod::Simple::PullParser
30
31=head1 SYNOPSIS
32
33(See L<Pod::Simple::PullParser>)
34
35=head1 DESCRIPTION
36
37When you do $parser->get_token on a L<Pod::Simple::PullParser>, you might
38get an object of this class.
39
40This is a subclass of L<Pod::Simple::PullParserToken> and inherits all its methods,
41and adds these methods:
42
43=over
44
45=item $token->tagname
46
47This returns the tagname for this end-token object.
48For example, parsing a "=head1 ..." line will give you
49a start-token with the tagname of "head1", token(s) for its
50content, and then an end-token with the tagname of "head1".
51
52=item $token->tagname(I<somestring>)
53
54This changes the tagname for this end-token object.
55You probably won't need to do this.
56
57=item $token->tag(...)
58
59A shortcut for $token->tagname(...)
60
61=item $token->is_tag(I<somestring>) or $token->is_tagname(I<somestring>)
62
63These are shortcuts for C<< $token->tag() eq I<somestring> >>
64
65=back
66
67You're unlikely to ever need to construct an object of this class for
68yourself, but if you want to, call
69C<<
70Pod::Simple::PullParserEndToken->new( I<tagname> )
71>>
72
73=head1 SEE ALSO
74
75L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing>
76
77=head1 COPYRIGHT AND DISCLAIMERS
78
79Copyright (c) 2002 Sean M. Burke. All rights reserved.
80
81This library is free software; you can redistribute it and/or modify it
82under the same terms as Perl itself.
83
84This program is distributed in the hope that it will be useful, but
85without any warranty; without even the implied warranty of
86merchantability or fitness for a particular purpose.
87
88=head1 AUTHOR
89
90Sean M. Burke C<sburke@cpan.org>
91
92=cut
93