summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2010-12-15 18:34:59 -0700
committerKarl Williamson <public@khwilliamson.com>2010-12-20 16:05:35 -0700
commit390656605358790e356331349a2f922ae36ae5df (patch)
tree1bb444ae420b11af97ee5cbc3560144db454e3ac /regcomp.h
parentf53580fec42f3b12264ee27b756dec257c0bb77a (diff)
downloadperl-390656605358790e356331349a2f922ae36ae5df.tar.gz
Change name of regex intrnl macro to new meaning
ANYOF_FOLD is now used only under fewer conditions. Otherwise the bitmap of character 0-255 is fully calculated with the folds, and the flag is not set. One condition is under locale, where the folds aren't known at compile time; the other is for things accessible through a swash. By changing the name to its new meaning, certain optimizations become more obvious.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/regcomp.h b/regcomp.h
index 00fd94517f..3e87aa93ec 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -314,9 +314,18 @@ struct regnode_charclass_class {
/* Flags for node->flags of ANYOF */
-#define ANYOF_LOCALE 0x01
-#define ANYOF_FOLD 0x02
-#define ANYOF_INVERT 0x04
+#define ANYOF_LOCALE 0x01
+
+/* The fold is calculated and stored in the bitmap where possible at compile
+ * time. However there are two cases where it isn't possible. These share
+ * this bit: 1) under locale, where the actual folding varies depending on
+ * what the locale is at the time of execution; and 2) where the folding is
+ * specified in a swash, not the bitmap, such as characters which aren't
+ * specified in the bitmap, or properties that aren't looked at at compile time
+ */
+#define ANYOF_LOC_NONBITMAP_FOLD 0x02
+
+#define ANYOF_INVERT 0x04
/* CLASS is never set unless LOCALE is too: has runtime \d, \w, [:posix:], ... */
#define ANYOF_CLASS 0x08