This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regen/ebcdic.pl: Output tables in hex
[perl5.git] / regen / overload.pl
index 88e2153..c95ab2d 100644 (file)
@@ -3,7 +3,7 @@
 # Regenerate (overwriting only if changed):
 #
 #    overload.h
-#    overload.c
+#    overload.inc
 #    lib/overload/numbers.pm
 #
 # from information stored in the DATA section of this file.
@@ -30,13 +30,16 @@ while (<DATA>) {
   push @names, $name;
 }
 
-my $c = safer_open('overload.c-new', 'overload.c');
-my $h = safer_open('overload.h-new', 'overload.h');
-mkdir("lib/overload", 0777) unless -d 'lib/overload';
-my $p = safer_open('lib/overload/numbers.pm-new', 'lib/overload/numbers.pm');
+my ($c, $h) = map {
+    open_new($_, '>',
+            { by => 'regen/overload.pl', file => $_, style => '*',
+              copyright => [1997, 1998, 2000, 2001, 2005 .. 2007, 2011] });
+} 'overload.inc', 'overload.h';
 
-print $p read_only_top(lang => 'Perl', by => 'regen/overload.pl',
-                      file => 'lib/overload/numbers.pm', copyright => [2008]);
+mkdir("lib/overload", 0777) unless -d 'lib/overload';
+my $p = open_new('lib/overload/numbers.pm', '>',
+                { by => 'regen/overload.pl',
+                  file => 'lib/overload/numbers.pm', copyright => [2008] });
 
 {
 local $" = "\n    ";
@@ -57,14 +60,6 @@ our \@enums = qw#
 EOF
 }
 
-for ([$c, 'overload.c'], [$h, 'overload.h']) {
-    my ($handle, $file) = @$_;
-    print $handle read_only_top(lang => 'C', by => 'regen/overload.pl',
-                               file => $file, style => '*',
-                               copyright => [1997, 1998, 2000, 2001,
-                                            2005 .. 2007, 2011]);
-}
-
 print $h "enum {\n";
 
 for (0..$#enums) {
@@ -183,13 +178,20 @@ rshift            (>>
 rshift_ass     (>>=
 band           (&
 band_ass       (&=
+sband          (&.
+sband_ass      (&.=
 bor            (|
 bor_ass                (|=
+sbor           (|.
+sbor_ass       (|.=
 bxor           (^
 bxor_ass       (^=
+sbxor          (^.
+sbxor_ass      (^.=
 ncmp           (<=>
 scmp           (cmp
 compl          (~
+scompl         (~.
 atan2          (atan2
 cos            (cos
 sin            (sin
@@ -203,5 +205,3 @@ concat_ass  (.=
 smart          (~~
 ftest           (-X
 regexp          (qr
-# Note: Perl_Gv_AMupdate() assumes that DESTROY is the last entry
-DESTROY                DESTROY