diff options
author | Karl Williamson <public@khwilliamson.com> | 2010-12-26 10:39:12 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-01-16 19:13:23 -0700 |
commit | b988e673a1322982f92dcce5bc82b973c29216ed (patch) | |
tree | 954dbbb0d81c75379e4cfadd16afc74c13d49beb /regcomp.h | |
parent | 50e911483ad5c29e25c54c9f81f92df974dd2cc0 (diff) | |
download | perl-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.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |