Commit | Line | Data |
---|---|---|
351625bd SP |
1 | |
2 | require 5; | |
3 | package Pod::Simple::PullParserEndToken; | |
4 | use Pod::Simple::PullParserToken (); | |
351625bd | 5 | use strict; |
a242eeb4 JV |
6 | use vars qw(@ISA $VERSION); |
7 | @ISA = ('Pod::Simple::PullParserToken'); | |
9dd0d393 | 8 | $VERSION = '3.26'; |
351625bd SP |
9 | |
10 | sub new { # Class->new(tagname); | |
11 | my $class = shift; | |
12 | return bless ['end', @_], ref($class) || $class; | |
13 | } | |
14 | ||
15 | # Purely accessors: | |
16 | ||
17 | sub tagname { (@_ == 2) ? ($_[0][1] = $_[1]) : $_[0][1] } | |
18 | sub tag { shift->tagname(@_) } | |
19 | ||
20 | # shortcut: | |
21 | sub is_tagname { $_[0][1] eq $_[1] } | |
22 | sub is_tag { shift->is_tagname(@_) } | |
23 | ||
24 | 1; | |
25 | ||
26 | ||
27 | __END__ | |
28 | ||
29 | =head1 NAME | |
30 | ||
31 | Pod::Simple::PullParserEndToken -- end-tokens from Pod::Simple::PullParser | |
32 | ||
33 | =head1 SYNOPSIS | |
34 | ||
35 | (See L<Pod::Simple::PullParser>) | |
36 | ||
37 | =head1 DESCRIPTION | |
38 | ||
39 | When you do $parser->get_token on a L<Pod::Simple::PullParser>, you might | |
40 | get an object of this class. | |
41 | ||
42 | This is a subclass of L<Pod::Simple::PullParserToken> and inherits all its methods, | |
43 | and adds these methods: | |
44 | ||
45 | =over | |
46 | ||
47 | =item $token->tagname | |
48 | ||
49 | This returns the tagname for this end-token object. | |
50 | For example, parsing a "=head1 ..." line will give you | |
51 | a start-token with the tagname of "head1", token(s) for its | |
52 | content, and then an end-token with the tagname of "head1". | |
53 | ||
54 | =item $token->tagname(I<somestring>) | |
55 | ||
56 | This changes the tagname for this end-token object. | |
57 | You probably won't need to do this. | |
58 | ||
59 | =item $token->tag(...) | |
60 | ||
61 | A shortcut for $token->tagname(...) | |
62 | ||
63 | =item $token->is_tag(I<somestring>) or $token->is_tagname(I<somestring>) | |
64 | ||
65 | These are shortcuts for C<< $token->tag() eq I<somestring> >> | |
66 | ||
67 | =back | |
68 | ||
69 | You're unlikely to ever need to construct an object of this class for | |
70 | yourself, but if you want to, call | |
71 | C<< | |
72 | Pod::Simple::PullParserEndToken->new( I<tagname> ) | |
73 | >> | |
74 | ||
75 | =head1 SEE ALSO | |
76 | ||
77 | L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing> | |
78 | ||
a242eeb4 JV |
79 | =head1 SUPPORT |
80 | ||
81 | Questions or discussion about POD and Pod::Simple should be sent to the | |
82 | pod-people@perl.org mail list. Send an empty email to | |
83 | pod-people-subscribe@perl.org to subscribe. | |
84 | ||
85 | This module is managed in an open GitHub repository, | |
9dd0d393 | 86 | L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or |
a242eeb4 JV |
87 | to clone L<git://github.com/theory/pod-simple.git> and send patches! |
88 | ||
89 | Patches against Pod::Simple are welcome. Please send bug reports to | |
90 | <bug-pod-simple@rt.cpan.org>. | |
91 | ||
351625bd SP |
92 | =head1 COPYRIGHT AND DISCLAIMERS |
93 | ||
433cf6b4 | 94 | Copyright (c) 2002 Sean M. Burke. |
351625bd SP |
95 | |
96 | This library is free software; you can redistribute it and/or modify it | |
97 | under the same terms as Perl itself. | |
98 | ||
99 | This program is distributed in the hope that it will be useful, but | |
100 | without any warranty; without even the implied warranty of | |
101 | merchantability or fitness for a particular purpose. | |
102 | ||
103 | =head1 AUTHOR | |
104 | ||
a242eeb4 JV |
105 | Pod::Simple was created by Sean M. Burke <sburke@cpan.org>. |
106 | But don't bother him, he's retired. | |
351625bd | 107 | |
a242eeb4 | 108 | Pod::Simple is maintained by: |
351625bd | 109 | |
a242eeb4 JV |
110 | =over |
111 | ||
112 | =item * Allison Randal C<allison@perl.org> | |
113 | ||
114 | =item * Hans Dieter Pearcey C<hdp@cpan.org> | |
115 | ||
116 | =item * David E. Wheeler C<dwheeler@cpan.org> | |
117 | ||
118 | =back | |
119 | ||
120 | =cut |