Skip to content

Commit 138d823

Browse files
committed
Add support for package attributes
1 parent a630b47 commit 138d823

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

lib/ExtUtils/MM_Unix.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3029,7 +3029,7 @@ sub parse_version {
30293029
next if $inpod || /^\s*#/;
30303030
chop;
30313031
next if /^\s*(if|unless|elsif)/;
3032-
if ( m{^ \s* (?:package|class) \s+ \w[\w\:\']* \s+ (v?[0-9._]+) \s* (;|\{) }x ) {
3032+
if ( m{^ \s* (?:package|class) \s+ \w[\w\:\']* \s+ (v?[0-9._]+) \s* (:|;|\{) }x ) {
30333033
no warnings;
30343034
$result = $1;
30353035
}

t/parse_version.t

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,22 @@ if ( "$]" >= 5.038 ) {
123123
$versions{' class Foo::Bar v1.2.3 { }' } = 'v1.2.3';
124124
$versions{"class Foo'Bar 1.23 { }" } = '1.23';
125125
$versions{'class Foo 1.230 { }' } = '1.230';
126+
127+
$versions{'class Foo 1.23 :isa(Bar);' } = '1.23';
128+
$versions{'class Foo::Bar 1.23 :isa(Bar);' } = '1.23';
129+
$versions{'class Foo v1.2.3 :isa(Bar);' } = 'v1.2.3';
130+
$versions{'class Foo::Bar v1.2.3 :isa(Bar);' } = 'v1.2.3';
131+
$versions{' class Foo::Bar v1.2.3 :isa(Bar);' } = 'v1.2.3';
132+
$versions{"class Foo'Bar 1.23 :isa(Bar);" } = '1.23';
133+
$versions{'class Foo 1.230 :isa(Bar);' } = '1.230';
134+
135+
$versions{'class Foo 1.23 :isa(Bar) { }' } = '1.23';
136+
$versions{'class Foo::Bar 1.23 :isa(Bar) { }' } = '1.23';
137+
$versions{'class Foo v1.2.3 :isa(Bar) { }' } = 'v1.2.3';
138+
$versions{'class Foo::Bar v1.2.3 :isa(Bar) { }' } = 'v1.2.3';
139+
$versions{' class Foo::Bar v1.2.3 :isa(Bar) { }' } = 'v1.2.3';
140+
$versions{"class Foo'Bar 1.23 :isa(Bar) { }" } = '1.23';
141+
$versions{'class Foo 1.230 :isa(Bar) { }' } = '1.230';
126142
}
127143

128144
if ( "$]" < 5.012 ) {

0 commit comments

Comments
 (0)