summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/regcomp.h b/regcomp.h
index 3a3add311c..ac13597622 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -191,9 +191,23 @@ struct regnode_charclass_class {
U32 classflags; /* and run-time */
};
-/* Synthetic start class; is a regnode_charclass_class plus an SV*. Note that
- * the 'next_off' field is unused, as the SSC stands alone, so there is never a
- * next node. */
+/* like above, but also has folds that are used only if the runtime locale is
+ * UTF-8. */
+struct regnode_charclass_posixl_fold {
+ U8 flags; /* ANYOF_POSIXL bit must go here */
+ U8 type;
+ U16 next_off;
+ U32 arg1; /* used as ptr in S_regclass */
+ char bitmap[ANYOF_BITMAP_SIZE]; /* both compile-time */
+ U32 classflags; /* and run-time */
+ SV* utf8_locale_list; /* list of code points matched by folds
+ in a UTF-8 locale */
+};
+
+/* A synthetic start class; is a regnode_charclass_posixl_fold, plus an extra
+ * SV*, used only during its construction and which is not used by regexec.c.
+ * Note that the 'next_off' field is unused, as the SSC stands alone, so there
+ * is never a next node. */
struct regnode_ssc {
U8 flags; /* ANYOF_POSIXL bit must go here */
U8 type;
@@ -201,6 +215,8 @@ struct regnode_ssc {
U32 arg1; /* used as ptr in S_regclass */
char bitmap[ANYOF_BITMAP_SIZE]; /* both compile-time */
U32 classflags; /* and run-time */
+ SV* utf8_locale_list; /* list of code points matched by folds
+ in a UTF-8 locale */
SV* invlist; /* list of code points matched */
};
@@ -470,6 +486,7 @@ struct regnode_ssc {
#define ANYOF_SIZE (sizeof(struct regnode_charclass))
#define ANYOF_POSIXL_SIZE (sizeof(regnode_charclass_posixl))
#define ANYOF_CLASS_SIZE ANYOF_POSIXL_SIZE
+#define ANYOF_POSIXL_FOLD_SIZE (sizeof(regnode_charclass_posixl_fold))
#define ANYOF_FLAGS(p) ((p)->flags)
@@ -522,8 +539,11 @@ struct regnode_ssc {
#define ANYOF_SKIP ((ANYOF_SIZE - 1)/sizeof(regnode))
#define ANYOF_POSIXL_SKIP ((ANYOF_POSIXL_SIZE - 1)/sizeof(regnode))
+#define ANYOF_POSIXL_FOLD_SKIP ((ANYOF_POSIXL_FOLD_SIZE - 1)/sizeof(regnode))
#define ANYOF_CLASS_SKIP ANYOF_POSIXL_SKIP
+#define ANYOF_UTF8_LOCALE_INVLIST(node) (((regnode_charclass_posixl_fold*) (node))->utf8_locale_list)
+
/*
* Utility definitions.
*/