Skip Menu |
 

This queue is for tickets about the Perl-Tags CPAN distribution.

Report information
The Basics
Id: 20616
Status: resolved
Priority: 0/
Queue: Perl-Tags

People
Owner: Nobody in particular
Requestors: DMITRI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.23
Fixed in: (no value)

Attachments


Subject: Add support for label statements.
Download (untitled) / with headers
text/plain 124b
Attached patch adds support for parsing labels: # tag for 'XYZ' will be generated. XYZ : { # do something } - Dmitri.
Subject: perl-tags-label.patch.txt
--- Tags.pm 21 Jul 2006 18:37:03 -0000 1.3 +++ Tags.pm 21 Jul 2006 18:38:03 -0000 1.4 @@ -400,6 +400,7 @@ $self->can('sub_line'), $self->can('use_constant'), $self->can('use_line'), + $self->can('label_line'), ); } @@ -556,6 +557,28 @@ return @ret; } +=item C<label_line> + +Parse label declaration. + +=cut + +sub label_line { + my ($self, $line, $statement, $file) = @_; + if ($statement=~/^\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*:(?:[^:]|$)/) { + return ( + Perl::Tags::Tag::Label->new( + name => $1, + file => $file, + line => $line, + linenum => $., + ) + ); + } + + return; +} + =back =head1 C<Perl::Tags::Tag> @@ -754,6 +777,17 @@ sub type { 'c' } +=head1 C<Perl::Tags::Tag::Label> + +=head2 C<type>: l + +=cut + +package Perl::Tags::Tag::Label; +our @ISA = qw/Perl::Tags::Tag/; + +sub type { 'l' } + =head1 C<Perl::Tags::Tag::Recurse> =head2 C<type>: dummy
Patch merged in 0.24


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.