diff --git a/regcomp.h b/regcomp.h index 062bd019f59..06e179dca60 100644 --- a/regcomp.h +++ b/regcomp.h @@ -204,15 +204,16 @@ struct regnode_charclass { U8 flags; U8 type; U16 next_off; - U32 arg1; + U32 arg1; /* used as ptr in S_regclass */ char bitmap[ANYOF_BITMAP_SIZE]; /* only compile-time */ }; -struct regnode_charclass_class { /* has [[:blah:]] classes */ - U8 flags; /* should have ANYOF_CLASS here */ +/* has runtime (locale) \d, \w, ..., [:posix:] classes */ +struct regnode_charclass_class { + U8 flags; /* ANYOF_CLASS bit must go here */ U8 type; U16 next_off; - U32 arg1; + U32 arg1; /* used as ptr in S_regclass */ char bitmap[ANYOF_BITMAP_SIZE]; /* both compile-time */ char classflags[ANYOF_CLASSBITMAP_SIZE]; /* and run-time */ }; @@ -271,7 +272,7 @@ struct regnode_charclass_class { /* has [[:blah:]] classes */ #undef STRING #define OP(p) ((p)->type) -#define FLAGS(p) ((p)->flags) /* Caution: Doesn't apply to all +#define FLAGS(p) ((p)->flags) /* Caution: Doesn't apply to all \ regnode types */ #define OPERAND(p) (((struct regnode_string *)p)->string) #define MASK(p) ((char*)OPERAND(p)) @@ -319,12 +320,11 @@ struct regnode_charclass_class { /* has [[:blah:]] classes */ #define ANYOF_FOLD 0x02 #define ANYOF_LOCALE 0x01 -/* Used for regstclass only */ -#define ANYOF_EOS 0x10 /* Can match an empty string too */ +/* EOS used for regstclass only */ +#define ANYOF_EOS 0x10 /* Can match an empty string too */ -/* There is a character or a range past 0xff */ -#define ANYOF_UNICODE 0x20 -#define ANYOF_UNICODE_ALL 0x40 /* Can match any char past 0xff */ +#define ANYOF_UNICODE 0x20 /* Matches >= one thing past 0xff */ +#define ANYOF_UNICODE_ALL 0x40 /* Matches 0x100 - infinity */ /* Are there any runtime flags on in this node? */ #define ANYOF_RUNTIME(s) (ANYOF_FLAGS(s) & 0x0f)