This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
B/Makefile.PL: Allow constants to be long/unsigned
authorKarl Williamson <khw@cpan.org>
Wed, 24 Sep 2014 18:49:13 +0000 (12:49 -0600)
committerKarl Williamson <khw@cpan.org>
Mon, 29 Sep 2014 17:07:40 +0000 (11:07 -0600)
This looks for numerical constants, but failed to see long and/or
unsigned ones, which have suffixes U and/or L, or lowercase u and/or l.

ext/B/Makefile.PL

index 81f6826..e70e8fd 100644 (file)
@@ -43,10 +43,14 @@ foreach my $tuple (['cop.h'],
     open my $fh, '<', $path or die "Cannot open $path: $!";
     while (<$fh>) {
        push @names, $1 if (/ \#define \s+ ( $pfx \w+ ) \s+
-                             ( [()|\dx]+             # Parens, '|', digits, 'x'
-                             | \(? \d+ \s* << .*?    # digits left shifted by anything
-                             ) \s* (?: $| \/ \* )    # ending at comment or $
-                           /x);
+            ( [()|\dx]+ [UuLl]{0,2}            # Parens, '|', digits, 'x',
+                                               # followed by optional long,
+                                               # unsigned qualifiers
+            | \(? \d+ [UuLl]{0,2} \s* << .*?   # digits left shifted by anything
+                                               # followed by optional
+                                               # long, unsigned qualifiers
+            ) \s* (?: $| \/ \* )               # ending at comment or $
+        /x);
     }
     close $fh;
 }