summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-12-12 19:06:47 -0700
committerKarl Williamson <public@khwilliamson.com>2012-12-22 11:11:27 -0700
commitb44daeeb190231d5713adfe3407398da836d42e5 (patch)
treefe1f1cb866160ce7c65da96504a59677a636d539 /handy.h
parentbd53f4624016a44f7c3ebcb22c88fd1d750d86c7 (diff)
downloadperl-b44daeeb190231d5713adfe3407398da836d42e5.tar.gz
regcomp.c: Use table look-up instead of individual strings.
This changes to get the name for the character class's Unicode property via table lookup. This is in preparation for making most of the cases in this switch identical, so they can be collapsed.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/handy.h b/handy.h
index 1ca45b6b7e..c8edc2b546 100644
--- a/handy.h
+++ b/handy.h
@@ -802,13 +802,17 @@ typedef enum {
#define POSIX_SWASH_COUNT _FIRST_NON_SWASH_CC
-#if defined(PERL_IN_UTF8_C)
+#if defined(PERL_IN_UTF8_C) || defined(PERL_IN_REGCOMP_C)
# if _CC_WORDCHAR != 0 || _CC_DIGIT != 1 || _CC_ALPHA != 2 || _CC_LOWER != 3 \
|| _CC_UPPER != 4 || _CC_PUNCT != 5 || _CC_PRINT != 6 \
|| _CC_ALPHANUMERIC != 7 || _CC_GRAPH != 8
#error Need to adjust order of swash_property_names[]
# endif
+/* This is declared static in each of the few files that this is #defined for
+ * to keep them from being publicly accessible. Hence there is a small amount
+ * of wasted space */
+
static const char* const swash_property_names[] = {
"XPosixWord",
"XPosixDigit",