summaryrefslogtreecommitdiff
path: root/lib/AutoSplit.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/AutoSplit.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/AutoSplit.pm')
-rw-r--r--lib/AutoSplit.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/AutoSplit.pm b/lib/AutoSplit.pm
index 33c0b9a03d..feecd58bf1 100644
--- a/lib/AutoSplit.pm
+++ b/lib/AutoSplit.pm
@@ -11,7 +11,7 @@ use vars qw(
$Verbose $Keep $Maxlen $CheckForAutoloader $CheckModTime
);
-$VERSION = "1.0303";
+$VERSION = "1.0304";
@ISA = qw(Exporter);
@EXPORT = qw(&autosplit &autosplit_lib_modules);
@EXPORT_OK = qw($Verbose $Keep $Maxlen $CheckForAutoloader $CheckModTime);
@@ -147,6 +147,13 @@ if (defined (&Dos::UseLFN)) {
}
my $Is_VMS = ($^O eq 'VMS');
+# 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 autosplit{
my($file, $autodir, $keep, $ckal, $ckmt) = @_;
@@ -289,7 +296,7 @@ sub autosplit_file {
if (/^package\s+([\w:]+)\s*;/) {
$this_package = $def_package = $1;
}
- if (/^sub\s+([\w:]+)(\s*\(.*?\))?/) {
+ if (/^sub\s+([\w:]+)(\s*(?:\(.*?\))?(?:$attr_list)?)/) {
print OUT "# end of $last_package\::$subname\n1;\n"
if $last_package;
$subname = $1;
@@ -459,3 +466,6 @@ sub test6 { return join ":", __FILE__,__LINE__; }
package Yet::Another::AutoSplit;
sub testtesttesttest4_1 ($) { "another test 4\n"; }
sub testtesttesttest4_2 ($$) { "another duplicate test 4\n"; }
+package Yet::More::Attributes;
+sub test_a1 ($) : locked { 1; }
+sub test_a2 : locked { 1; }