| Perl-Tags documentation | Contained in the Perl-Tags distribution. |
get_parsersThe following parsers are defined by this module.
field_lineParse the declaration of a Spiffy class accessor method, returning a Perl::Tags::Tag::Field if found.
stub_lineParse the declaration of a Spiffy stub method, returning a Perl::Tags::Tag::Stub if found.
Perl::Tags::Tag::Fieldtype: FieldPerl::Tags::Tag::Stubtype: Stub dr bean - drbean at sign cpan a dot org
osfameron (2006) - osfameron@gmail.com
For support, try emailing me or grabbing me on irc #london.pm on irc.perl.org
This was originally ripped off pltags.pl, as distributed with vim and available from http://www.mscha.com/mscha.html?pltags#tools Version 2.3, 28 February 2002 Written by Michael Schaap <pltags@mscha.com>.
This is licensed under the same terms as Perl itself. (Or as Vim if you +prefer).
| Perl-Tags documentation | Contained in the Perl-Tags distribution. |
package Perl::Tags::Naive::Spiffy; use base qw/Perl::Tags::Naive/;
sub get_parsers { my $self = shift; return ( $self->SUPER::get_parsers(), $self->can('field_line'), $self->can('stub_line'), ); }
sub field_line { my ($self, $line, $statement, $file) = @_; if ($statement=~/field\s+["']?(\w+)\b/) { return ( Perl::Tags::Tag::Field->new( name => $1, file => $file, line => $line, linenum => $., ) ); } return; }
sub stub_line { my ($self, $line, $statement, $file) = @_; if ($statement=~/stub\s+["']?(\w+)\b/) { return ( Perl::Tags::Tag::Stub->new( name => $1, file => $file, line => $line, linenum => $., ) ); } return; }
package Perl::Tags::Tag::Field; our @ISA = qw/Perl::Tags::Tag/; sub type { 'Field' }
package Perl::Tags::Tag::Stub; our @ISA = qw/Perl::Tags::Tag/; sub type { 'Stub' } 1;