summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-12-23 13:49:02 -0700
committerKarl Williamson <public@khwilliamson.com>2012-12-23 14:05:28 -0700
commiteba68aa09a0b159ee4eef3cee1bd58ee95fdb81a (patch)
tree4a3fd382c4ba851804dfbe58044b6d96ed20ed28 /utf8.c
parent31a09021a5558064a4417036c917712e2435edf7 (diff)
downloadperl-eba68aa09a0b159ee4eef3cee1bd58ee95fdb81a.tar.gz
handy.h: Add full complement of isIDCONT() macros
This also changes isIDCONT_utf8() to use the Perl definition, which excludes any \W characters (the Unicode definition includes a few of these). Tests are also added. These macros remain undocumented for now.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index ec4e62799b..dfb303f311 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1528,6 +1528,14 @@ Perl_is_uni_idfirst(pTHX_ UV c)
}
bool
+Perl__is_uni_perl_idcont(pTHX_ UV c)
+{
+ U8 tmpbuf[UTF8_MAXBYTES+1];
+ uvchr_to_utf8(tmpbuf, c);
+ return _is_utf8_perl_idcont(tmpbuf);
+}
+
+bool
Perl__is_uni_perl_idstart(pTHX_ UV c)
{
U8 tmpbuf[UTF8_MAXBYTES+1];
@@ -2120,6 +2128,17 @@ Perl__is_utf8_perl_idstart(pTHX_ const U8 *p)
}
bool
+Perl__is_utf8_perl_idcont(pTHX_ const U8 *p)
+{
+ dVAR;
+
+ PERL_ARGS_ASSERT__IS_UTF8_PERL_IDCONT;
+
+ return is_utf8_common(p, &PL_utf8_perl_idcont, "_Perl_IDCont");
+}
+
+
+bool
Perl_is_utf8_idcont(pTHX_ const U8 *p)
{
dVAR;