X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/96ac09754b53d56f88a3effe7c9c82d363d89ee5..50646f6f0beccf4783bfef8cb75375f49c727140:/handy.h diff --git a/handy.h b/handy.h index ee4d668..b75eafb 100644 --- a/handy.h +++ b/handy.h @@ -470,7 +470,7 @@ There are three variants for all the functions in this section. The base ones operate using the character set of the platform Perl is running on. The ones with an C<_A> suffix operate on the ASCII character set, and the ones with an C<_L1> suffix operate on the full Latin1 character set. All are unaffected by -locale +locale. For ASCII platforms, the base function with no suffix and the one with the C<_A> suffix are identical. The function with the C<_L1> suffix imposes the @@ -640,6 +640,8 @@ EXTCONST U32 PL_charclass[]; # define isUPPER_A(c) cBOOL(FITS_IN_8_BITS(c) && (PL_charclass[(U8) NATIVE_TO_UNI(c)] & _CC_UPPER_A)) # define isWORDCHAR_A(c) cBOOL(FITS_IN_8_BITS(c) && (PL_charclass[(U8) NATIVE_TO_UNI(c)] & _CC_WORDCHAR_A)) # define isXDIGIT_A(c) cBOOL(FITS_IN_8_BITS(c) && (PL_charclass[(U8) NATIVE_TO_UNI(c)] & _CC_XDIGIT_A)) + /* Either participates in a fold with a character above 255, or is a + * multi-char fold */ # define _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) ((! cBOOL(FITS_IN_8_BITS(c))) || (PL_charclass[(U8) NATIVE_TO_UNI(c)] & _CC_NONLATIN1_FOLD)) #else /* No perl.h. */ # define isOCTAL_A(c) ((c) >= '0' && (c) <= '9') @@ -881,16 +883,13 @@ EXTCONST U32 PL_charclass[]; #define isBLANK_LC_uni(c) isBLANK(c) /* could be wrong */ #define isALNUM_utf8(p) is_utf8_alnum(p) -/* The ID_Start of Unicode was originally quite limiting: it assumed an - * L-class character (meaning that you could not have, say, a CJK charac- - * ter). So, instead, perl has for a long time allowed ID_Continue but - * not digits. - * We still preserve that for backward compatibility. But we also make sure - * that it is alphanumeric, so S_scan_word in toke.c will not hang. See - * http://rt.perl.org/rt3/Ticket/Display.html?id=74022 - * for more detail than you ever wanted to know about. */ -#define isIDFIRST_utf8(p) \ - (is_utf8_idcont(p) && !is_utf8_digit(p) && is_utf8_alnum(p)) +/* To prevent S_scan_word in toke.c from hanging, we have to make sure that + * IDFIRST is an alnum. See + * http://rt.perl.org/rt3/Ticket/Display.html?id=74022 + * for more detail than you ever wanted to know about. This used to be not the + * XID version, but we decided to go with the more modern Unicode definition */ +#define isIDFIRST_utf8(p) (is_utf8_xidfirst(p) && is_utf8_alnum(p)) +#define isIDCONT_utf8(p) is_utf8_xidcont(p) #define isALPHA_utf8(p) is_utf8_alpha(p) #define isSPACE_utf8(p) is_utf8_space(p) #define isDIGIT_utf8(p) is_utf8_digit(p) @@ -955,7 +954,7 @@ The XSUB-writer's interface to the C C function. In 5.9.3, Newx() and friends replace the older New() API, and drops the first parameter, I, a debug aid which allowed callers to identify themselves. This aid has been superseded by a new build option, -PERL_MEM_LOG (see L). The older API is still +PERL_MEM_LOG (see L). The older API is still there for use in XS modules supporting older perls. =for apidoc Am|void|Newxc|void* ptr|int nitems|type|cast