From 693fefec6759ebf0a9ec40a0f59346d86831349c Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 27 Jun 2012 13:48:16 -0600 Subject: regcomp.c: Simply some node calculations For the node types that have differing versions depending on the character set regex modifiers, /d, /l, /u, /a, and /aa, we can use the enum values as offsets from the base node number to derive the correct one. This eliminates a number of tests. Because there is no DIGITU node type, I added placeholders for it (and NDIGITU) to avoid some special casing of it (more important in future commits). We currently have many available node types, so can afford to waste these two. --- op_reg_common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'op_reg_common.h') diff --git a/op_reg_common.h b/op_reg_common.h index f35cb7d233..8a45b200b4 100644 --- a/op_reg_common.h +++ b/op_reg_common.h @@ -36,7 +36,9 @@ /* The character set for the regex is stored in a field of more than one bit * using an enum, for reasons of compactness and to ensure that the options are * mutually exclusive */ -/* Make sure to update ext/re/re.pm when changing this! */ +/* Make sure to update ext/re/re.pm and regcomp.sym (as these are used as + * offsets for various node types, like SPACE vs SPACEL, etc) when changing + * this! */ typedef enum { REGEX_DEPENDS_CHARSET = 0, REGEX_LOCALE_CHARSET, -- cgit v1.2.1