xref: /openbsd-src/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm (revision 3d61058aa5c692477b6d18acfbbdb653a9930ff9)
1package Pod::Simple::PullParserEndToken;
2use strict;
3use warnings;
4use Pod::Simple::PullParserToken ();
5our @ISA = ('Pod::Simple::PullParserToken');
6our $VERSION = '3.45';
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 SUPPORT
78
79Questions or discussion about POD and Pod::Simple should be sent to the
80pod-people@perl.org mail list. Send an empty email to
81pod-people-subscribe@perl.org to subscribe.
82
83This module is managed in an open GitHub repository,
84L<https://github.com/perl-pod/pod-simple/>. Feel free to fork and contribute, or
85to clone L<https://github.com/perl-pod/pod-simple.git> and send patches!
86
87Patches against Pod::Simple are welcome. Please send bug reports to
88<bug-pod-simple@rt.cpan.org>.
89
90=head1 COPYRIGHT AND DISCLAIMERS
91
92Copyright (c) 2002 Sean M. Burke.
93
94This library is free software; you can redistribute it and/or modify it
95under the same terms as Perl itself.
96
97This program is distributed in the hope that it will be useful, but
98without any warranty; without even the implied warranty of
99merchantability or fitness for a particular purpose.
100
101=head1 AUTHOR
102
103Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
104But don't bother him, he's retired.
105
106Pod::Simple is maintained by:
107
108=over
109
110=item * Allison Randal C<allison@perl.org>
111
112=item * Hans Dieter Pearcey C<hdp@cpan.org>
113
114=item * David E. Wheeler C<dwheeler@cpan.org>
115
116=back
117
118=cut
119