mktables: Add overloaded '+='
authorKarl Williamson <public@khwilliamson.com>
Mon, 16 Apr 2012 17:28:20 +0000 (11:28 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 23 May 2012 23:34:35 +0000 (17:34 -0600)
This was automatically generated before, in spite of fallback => 0, but
that has now been fixed by commit
f041cf0f9c6469c41de8b73d5f7b426710c3ff8b.  However, that change caused
another overloaded += to be used with the parameters swapped, resulting
in the table generated for Gc=Cs (the surrogates) to be wrong.  This
creates the proper overload.

lib/unicore/mktables

index 4018e95..637f296 100644 (file)
@@ -4174,6 +4174,21 @@ sub trace { return main::trace(@_); }
 
                     return $self->_union($other)
                 },
+        '+=' => sub { my $self = shift;
+                    my $other = shift;
+                    my $reversed = shift;
+
+                    if ($reversed) {
+                        Carp::my_carp_bug("Bad news.  Can't cope with '"
+                        . ref($other)
+                        . ' += '
+                        . ref($self)
+                        . "'.  undef returned.");
+                        return;
+                    }
+
+                    return $self->_union($other)
+                },
         '&' => sub { my $self = shift;
                     my $other = shift;