This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Adriano Ferreira prefers blead as upstream
[perl5.git] / overload.c
index 0a220cc..909a0ee 100644 (file)
  */
 
 #define AMG_id2name(id) (PL_AMG_names[id]+1)
+#define AMG_id2namelen(id) (PL_AMG_namelens[id]-1)
 
-char * const PL_AMG_names[NofAMmeth] = {
+static const U8 PL_AMG_namelens[NofAMmeth] = {
+    2,
+    4,
+    4,
+    4,
+    4,
+    4,
+    3,
+    3,
+    5,
+    3,
+    3,
+    2,
+    2,
+    4,
+    4,
+    3,
+    4,
+    2,
+    3,
+    2,
+    3,
+    3,
+    3,
+    3,
+    3,
+    3,
+    3,
+    3,
+    3,
+    9,
+    2,
+    3,
+    2,
+    3,
+    2,
+    3,
+    2,
+    3,
+    2,
+    3,
+    3,
+    4,
+    3,
+    4,
+    3,
+    4,
+    2,
+    3,
+    2,
+    3,
+    2,
+    3,
+    4,
+    4,
+    2,
+    6,
+    4,
+    4,
+    4,
+    4,
+    5,
+    2,
+    3,
+    2,
+    3,
+    3,
+    3,
+    7
+};
+
+static const char * const PL_AMG_names[NofAMmeth] = {
   /* Names kept in the symbol table.  fallback => "()", the rest has
      "(" prepended.  The only other place in perl which knows about
      this convention is AMG_id2name (used for debugging output and
@@ -86,5 +158,6 @@ char * const PL_AMG_names[NofAMmeth] = {
     "(.",
     "(.=",
     "(~~",
+    "(-X",
     "DESTROY"
 };