Skip Menu |
 

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

Report information
The Basics
Id: 20613
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 'use constant' statements.
The attached patch adds support for 'use constant ABC => 1'-type statements. - Dmitri.
Subject: perl-tags-use-constant.patch.txt
--- Tags.pm.orig 2006-07-21 11:55:09.000000000 -0400 +++ Tags.pm 2006-07-21 13:59:16.000000000 -0400 @@ -382,6 +398,7 @@ $self->can('variable'), $self->can('package_line'), $self->can('sub_line'), + $self->can('use_constant'), $self->can('use_line'), ); } @@ -491,6 +508,28 @@ return; } +=item C<use_constant> + +Parse a use costant directive. + +=cut + +sub use_constant { + my ($self, $line, $statement, $file) = @_; + if ($statement=~/^\s*use\s+constant\s+([^=[:space:]]+)/) { + return ( + Perl::Tags::Tag::Constant->new( + name => $1, + file => $file, + line => $line, + linenum => $., + ) + ); + } + + return; +} + =item C<use_line> Parse a use, require, and also a use_ok line (from Test::More). @@ -704,6 +743,17 @@ return 1; } +=head1 C<Perl::Tags::Tag::Constant> + +=head2 C<type>: c + +=cut + +package Perl::Tags::Tag::Constant; +our @ISA = qw/Perl::Tags::Tag/; + +sub type { 'c' } + =head1 C<Perl::Tags::Tag::Recurse> =head2 C<type>: dummy
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.