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 */
};
#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))
#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)