mktables: Add &= overload for Range_Lists
authorKarl Williamson <public@khwilliamson.com>
Fri, 8 Jun 2012 03:35:17 +0000 (21:35 -0600)
committerKarl Williamson <public@khwilliamson.com>
Fri, 8 Jun 2012 16:39:22 +0000 (10:39 -0600)
This is useful under the -annotate option

lib/unicore/mktables

index 8e30f94..e7aa869 100644 (file)
@@ -4279,6 +4279,21 @@ sub trace { return main::trace(@_); }
         '&' => sub { my $self = shift;
                     my $other = shift;
 
+                    return $self->_intersect($other, 0);
+                },
+        '&=' => 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->_intersect($other, 0);
                 },
         '~' => "_invert",