Add overload types for string-specifc bitops
authorFather Chrysostomos <sprout@cpan.org>
Sun, 4 Jan 2015 01:55:53 +0000 (17:55 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 1 Feb 2015 06:03:50 +0000 (22:03 -0800)
lib/overload/numbers.pm
overload.c
overload.h
regen/overload.pl

index a90c175..ccea9e1 100644 (file)
@@ -62,13 +62,20 @@ our @names = qw#
     (>>=
     (&
     (&=
+    (&.
+    (&.=
     (|
     (|=
+    (|.
+    (|.=
     (^
     (^=
+    (^.
+    (^.=
     (<=>
     (cmp
     (~
+    (~.
     (atan2
     (cos
     (sin
@@ -133,13 +140,20 @@ our @enums = qw#
     rshift_ass
     band
     band_ass
+    sband
+    sband_ass
     bor
     bor_ass
+    sbor
+    sbor_ass
     bxor
     bxor_ass
+    sbxor
+    sbxor_ass
     ncmp
     scmp
     compl
+    scompl
     atan2
     cos
     sin
index cd28df4..3cf64c7 100644 (file)
@@ -65,13 +65,20 @@ static const U8 PL_AMG_namelens[NofAMmeth] = {
     4,
     2,
     3,
+    3,
+    4,
     2,
     3,
+    3,
+    4,
     2,
     3,
+    3,
+    4,
     4,
     4,
     2,
+    3,
     6,
     4,
     4,
@@ -141,13 +148,20 @@ static const char * const PL_AMG_names[NofAMmeth] = {
     "(>>=",            /* rshift_ass */
     "(&",              /* band       */
     "(&=",             /* band_ass   */
+    "(&.",             /* sband      */
+    "(&.=",            /* sband_ass  */
     "(|",              /* bor        */
     "(|=",             /* bor_ass    */
+    "(|.",             /* sbor       */
+    "(|.=",            /* sbor_ass   */
     "(^",              /* bxor       */
     "(^=",             /* bxor_ass   */
+    "(^.",             /* sbxor      */
+    "(^.=",            /* sbxor_ass  */
     "(<=>",            /* ncmp       */
     "(cmp",            /* scmp       */
     "(~",              /* compl      */
+    "(~.",             /* scompl     */
     "(atan2",          /* atan2      */
     "(cos",            /* cos        */
     "(sin",            /* sin        */
index 1628ac0..50e7660 100644 (file)
@@ -62,26 +62,33 @@ enum {
     rshift_ass_amg,    /* 0x2d >>=      */
     band_amg,          /* 0x2e &        */
     band_ass_amg,      /* 0x2f &=       */
-    bor_amg,           /* 0x30 |        */
-    bor_ass_amg,       /* 0x31 |=       */
-    bxor_amg,          /* 0x32 ^        */
-    bxor_ass_amg,      /* 0x33 ^=       */
-    ncmp_amg,          /* 0x34 <=>      */
-    scmp_amg,          /* 0x35 cmp      */
-    compl_amg,         /* 0x36 ~        */
-    atan2_amg,         /* 0x37 atan2    */
-    cos_amg,           /* 0x38 cos      */
-    sin_amg,           /* 0x39 sin      */
-    exp_amg,           /* 0x3a exp      */
-    log_amg,           /* 0x3b log      */
-    sqrt_amg,          /* 0x3c sqrt     */
-    repeat_amg,                /* 0x3d x        */
-    repeat_ass_amg,    /* 0x3e x=       */
-    concat_amg,                /* 0x3f .        */
-    concat_ass_amg,    /* 0x40 .=       */
-    smart_amg,         /* 0x41 ~~       */
-    ftest_amg,         /* 0x42 -X       */
-    regexp_amg,                /* 0x43 qr       */
+    sband_amg,         /* 0x30 &.       */
+    sband_ass_amg,     /* 0x31 &.=      */
+    bor_amg,           /* 0x32 |        */
+    bor_ass_amg,       /* 0x33 |=       */
+    sbor_amg,          /* 0x34 |.       */
+    sbor_ass_amg,      /* 0x35 |.=      */
+    bxor_amg,          /* 0x36 ^        */
+    bxor_ass_amg,      /* 0x37 ^=       */
+    sbxor_amg,         /* 0x38 ^.       */
+    sbxor_ass_amg,     /* 0x39 ^.=      */
+    ncmp_amg,          /* 0x3a <=>      */
+    scmp_amg,          /* 0x3b cmp      */
+    compl_amg,         /* 0x3c ~        */
+    scompl_amg,                /* 0x3d ~.       */
+    atan2_amg,         /* 0x3e atan2    */
+    cos_amg,           /* 0x3f cos      */
+    sin_amg,           /* 0x40 sin      */
+    exp_amg,           /* 0x41 exp      */
+    log_amg,           /* 0x42 log      */
+    sqrt_amg,          /* 0x43 sqrt     */
+    repeat_amg,                /* 0x44 x        */
+    repeat_ass_amg,    /* 0x45 x=       */
+    concat_amg,                /* 0x46 .        */
+    concat_ass_amg,    /* 0x47 .=       */
+    smart_amg,         /* 0x48 ~~       */
+    ftest_amg,         /* 0x49 -X       */
+    regexp_amg,                /* 0x4a qr       */
     max_amg_code
     /* Do not leave a trailing comma here.  C9X allows it, C89 doesn't. */
 };
index 6d9e04d..165e1c1 100644 (file)
@@ -178,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