summaryrefslogtreecommitdiff
path: root/lib/SelfLoader.pm
diff options
context:
space:
mode:
authorSpider Boardman <spider@orb.nashua.nh.us>1999-08-28 23:02:11 -0400
committerJarkko Hietaniemi <jhi@iki.fi>1999-08-29 11:10:33 +0000
commit09bef84370e90d727656ea11ba5ee8be80e361d3 (patch)
treea3be55423863d0b8aa13316472ce65fd1007390f /lib/SelfLoader.pm
parent34d1710f50a396dda66d4f7a7ffb73f6cc80cf01 (diff)
downloadperl-09bef84370e90d727656ea11ba5ee8be80e361d3.tar.gz
sub : attrlist
To: Mailing list Perl5 <perl5-porters@perl.org> Message-Id: <199908290702.DAA32191@Orb.Nashua.NH.US> p4raw-id: //depot/cfgperl@4043
Diffstat (limited to 'lib/SelfLoader.pm')
-rw-r--r--lib/SelfLoader.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/SelfLoader.pm b/lib/SelfLoader.pm
index c4e9175a79..4672ac49da 100644
--- a/lib/SelfLoader.pm
+++ b/lib/SelfLoader.pm
@@ -3,12 +3,18 @@ package SelfLoader;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(AUTOLOAD);
-$VERSION = "1.08";
+$VERSION = "1.09";
sub Version {$VERSION}
$DEBUG = 0;
my %Cache; # private cache for all SelfLoader's client packages
+# allow checking for valid ': attrlist' attachments
+my $nested;
+$nested = qr{ \( (?: (?> [^()]+ ) | (?p{ $nested }) )* \) }x;
+my $one_attr = qr{ (?> (?! \d) \w+ (?:$nested)? ) [\s,]* }x;
+my $attr_list = qr{ \s* : \s* (?: $one_attr )* }x;
+
sub croak { require Carp; goto &Carp::croak }
AUTOLOAD {
@@ -50,7 +56,7 @@ sub _load_stubs {
local($/) = "\n";
while(defined($line = <$fh>) and $line !~ m/^__END__/) {
- if ($line =~ m/^sub\s+([\w:]+)\s*(\([\\\$\@\%\&\*\;]*\))?/) {
+ if ($line =~ m/^sub\s+([\w:]+)\s*((?:\([\\\$\@\%\&\*\;]*\))?(?:$attr_list)?)/) {
push(@stubs, $self->_add_to_cache($name, $currpack, \@lines, $protoype));
$protoype = $2;
@lines = ($line);