summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2010-12-26 10:39:12 -0700
committerKarl Williamson <public@khwilliamson.com>2011-01-16 19:13:23 -0700
commitb988e673a1322982f92dcce5bc82b973c29216ed (patch)
tree954dbbb0d81c75379e4cfadd16afc74c13d49beb /regcomp.h
parent50e911483ad5c29e25c54c9f81f92df974dd2cc0 (diff)
downloadperl-b988e673a1322982f92dcce5bc82b973c29216ed.tar.gz
regex: Convert regnode FLAGS fields to charset enum
The FLAGS fields of certain regnodes were encoded with USE_UNI if unicode semantics were to be used. This patch instead sets them to the character set used, one of the possibilities of which is to use unicode semantics. This shortens the code somewhat, and always puts the character set in the flags field, which can allow use of switch statements on it for efficiency, especially as new values are added.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/regcomp.h b/regcomp.h
index 96e7ae14f6..48e270f5cf 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -272,8 +272,9 @@ struct regnode_charclass_class {
#undef STRING
#define OP(p) ((p)->type)
-#define FLAGS(p) ((p)->flags) /* Caution: Doesn't apply to all \
- regnode types */
+#define FLAGS(p) ((p)->flags) /* Caution: Doesn't apply to all \
+ regnode types. For some, it's the \
+ character set of the regnode */
#define OPERAND(p) (((struct regnode_string *)p)->string)
#define MASK(p) ((char*)OPERAND(p))
#define STR_LEN(p) (((struct regnode_string *)p)->str_len)