summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-06-23 12:57:54 -0600
committerKarl Williamson <public@khwilliamson.com>2012-06-29 22:22:40 -0600
commitbdd8600f35ec7851722b0fe8b4902e0e04ab2800 (patch)
tree6496d4e8e56d25152a3732a55d811bee1056db73 /handy.h
parentf74da94c18a7b3cbdb577015ae60665509e912e8 (diff)
downloadperl-bdd8600f35ec7851722b0fe8b4902e0e04ab2800.tar.gz
handy.h: Fix isBLANK_uni and isBLANK_utf8
These macros have never worked outside the Latin1 range, so this extends them to work. There are no tests I could find for things in handy.h, except that many of them are called all over the place during the normal course of events. This commit adds a new file for such testing, containing for now only with a few tests for the isBLANK's
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/handy.h b/handy.h
index abfc2c2f46..198ea0c708 100644
--- a/handy.h
+++ b/handy.h
@@ -912,6 +912,7 @@ EXTCONST U32 PL_charclass[];
/* Note that all ignore 'use bytes' */
#define isALNUM_uni(c) generic_uni(isWORDCHAR, is_uni_alnum, c)
+#define isBLANK_uni(c) generic_uni(isBLANK, is_uni_blank, c)
#define isIDFIRST_uni(c) generic_uni(isIDFIRST, is_uni_idfirst, c)
#define isALPHA_uni(c) generic_uni(isALPHA, is_uni_alpha, c)
#define isSPACE_uni(c) generic_uni(isSPACE, is_uni_space, c)
@@ -932,7 +933,6 @@ EXTCONST U32 PL_charclass[];
/* Posix and regular space differ only in U+000B, which is in Latin1 */
#define isPSXSPC_uni(c) ((c) < 256 ? isPSXSPC_L1(c) : isSPACE_uni(c))
-#define isBLANK_uni(c) isBLANK(c) /* could be wrong */
#define isALNUM_LC_uvchr(c) (c < 256 ? isALNUM_LC(c) : is_uni_alnum_lc(c))
#define isIDFIRST_LC_uvchr(c) (c < 256 ? isIDFIRST_LC(c) : is_uni_idfirst_lc(c))
@@ -981,6 +981,7 @@ EXTCONST U32 PL_charclass[];
: Perl__is_utf8__perl_idstart(aTHX_ p))
#define isIDCONT_utf8(p) generic_utf8(isWORDCHAR, is_utf8_xidcont, p)
#define isALPHA_utf8(p) generic_utf8(isALPHA, is_utf8_alpha, p)
+#define isBLANK_utf8(p) generic_utf8(isBLANK, is_utf8_blank, p)
#define isSPACE_utf8(p) generic_utf8(isSPACE, is_utf8_space, p)
#define isDIGIT_utf8(p) generic_utf8(isDIGIT, is_utf8_digit, p)
#define isUPPER_utf8(p) generic_utf8(isUPPER, is_utf8_upper, p)
@@ -1004,11 +1005,10 @@ EXTCONST U32 PL_charclass[];
? isPSXSPC_L1(TWO_BYTE_UTF8_TO_UNI(*(p), \
*((p)+1)))\
: isSPACE_utf8(p)))
-#define isBLANK_utf8(c) isBLANK(c) /* could be wrong */
-
#define isALNUM_LC_utf8(p) isALNUM_LC_uvchr(valid_utf8_to_uvchr(p, 0))
#define isIDFIRST_LC_utf8(p) isIDFIRST_LC_uvchr(valid_utf8_to_uvchr(p, 0))
#define isALPHA_LC_utf8(p) isALPHA_LC_uvchr(valid_utf8_to_uvchr(p, 0))
+#define isBLANK_LC_utf8(p) isBLANK_LC_uvchr(valid_utf8_to_uvchr(p, 0))
#define isSPACE_LC_utf8(p) isSPACE_LC_uvchr(valid_utf8_to_uvchr(p, 0))
#define isDIGIT_LC_utf8(p) isDIGIT_LC_uvchr(valid_utf8_to_uvchr(p, 0))
#define isUPPER_LC_utf8(p) isUPPER_LC_uvchr(valid_utf8_to_uvchr(p, 0))
@@ -1020,7 +1020,6 @@ EXTCONST U32 PL_charclass[];
#define isPUNCT_LC_utf8(p) isPUNCT_LC_uvchr(valid_utf8_to_uvchr(p, 0))
#define isPSXSPC_LC_utf8(c) (isSPACE_LC_utf8(c) ||(c) == '\f')
-#define isBLANK_LC_utf8(c) isBLANK(c) /* could be wrong */
/* This conversion works both ways, strangely enough. On EBCDIC platforms,
* CTRL-@ is 0, CTRL-A is 1, etc, just like on ASCII */