This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Increase $Term::ReadLine::VERSION to 1.15
[perl5.git] / regcomp.h
index f1f55eb..2b73d86 100644 (file)
--- a/regcomp.h
+++ b/regcomp.h
@@ -184,7 +184,20 @@ struct regnode_2 {
     U16 arg2;
 };
 
-#define NUM_ANYOF_CODE_POINTS   256
+/* This give the number of code points that can be in the bitmap of an ANYOF
+ * node.  The shift number must currently be one of: 8..12.  It can't be less
+ * than 8 (256) because some code relies on it being at least that.  Above 12
+ * (4096), and you start running into warnings that some data structure widths
+ * have been exceeded, though the test suite as of this writing still passes
+ * for up through 16, which is as high as anyone would ever want to go,
+ * encompassing all of the Unicode BMP, and thus including all the economically
+ * important world scripts.  At 12 most of them are: including Arabic,
+ * Cyrillic, Greek, Hebrew, Indian subcontinent, Latin, and Thai; but not Han,
+ * Japanese, nor Korean.  (The regarglen structure in regnodes.h is a U8, and
+ * the trie types TRIEC and AHOCORASICKC are larger than U8 for shift values
+ * below above 12.)  Be sure to benchmark before changing, as larger sizes do
+ * significantly slow down the test suite */
+#define NUM_ANYOF_CODE_POINTS   (1 << 8)
 
 #define ANYOF_BITMAP_SIZE      (NUM_ANYOF_CODE_POINTS / 8)   /* 8 bits/Byte */
 
@@ -214,7 +227,7 @@ struct regnode_charclass_class {
     U8  type;
     U16 next_off;
     U32 arg1;
-    char bitmap[ANYOF_BITMAP_SIZE];            /* both compile-time */
+    char bitmap[ANYOF_BITMAP_SIZE];            /* both compile-time ... */
     U32 classflags;                            /* and run-time */
 };
 
@@ -232,7 +245,7 @@ struct regnode_ssc {
     U8  type;
     U16 next_off;
     U32 arg1;
-    char bitmap[ANYOF_BITMAP_SIZE];    /* both compile-time */
+    char bitmap[ANYOF_BITMAP_SIZE];    /* both compile-time ... */
     U32 classflags;                    /* and run-time */
 
     /* Auxiliary, only used during construction; NULL afterwards: list of code