From 0eb30aebe20a48d634d4e484bc9e6005dffc1420 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 29 Dec 2012 20:51:00 -0700 Subject: [PATCH] Change core calls of isALNUM() to isWORDCHAR() The latter is more clearly named to indicate it includes the underscore. --- dist/Data-Dumper/Changes | 4 ++++ dist/Data-Dumper/Dumper.pm | 4 ++-- dist/Data-Dumper/Dumper.xs | 2 +- doio.c | 2 +- dquote_static.c | 2 +- op.c | 4 ++-- perl.c | 12 ++++++------ perlio.c | 2 +- regcomp.c | 8 ++++---- regexec.c | 34 +++++++++++++++++----------------- taint.c | 4 ++-- toke.c | 28 ++++++++++++++-------------- util.h | 2 +- 13 files changed, 56 insertions(+), 52 deletions(-) diff --git a/dist/Data-Dumper/Changes b/dist/Data-Dumper/Changes index 5ec8d25..cc66a36 100644 --- a/dist/Data-Dumper/Changes +++ b/dist/Data-Dumper/Changes @@ -6,6 +6,10 @@ Changes - public release history for Data::Dumper =over 8 +=item 2.140 (Dec 30 2012) + +Change call of isALNUM to equivalent but more clearly named isWORDCHAR + =item 2.139 (Dec 12 2012) Supply an explicit dynamic_config => 0 in META diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm index 4999576..4fefb72 100644 --- a/dist/Data-Dumper/Dumper.pm +++ b/dist/Data-Dumper/Dumper.pm @@ -10,7 +10,7 @@ package Data::Dumper; BEGIN { - $VERSION = '2.139'; # Don't forget to set version and release + $VERSION = '2.140'; # Don't forget to set version and release } # date in POD below! #$| = 1; @@ -1359,7 +1359,7 @@ modify it under the same terms as Perl itself. =head1 VERSION -Version 2.139 (December 12 2012) +Version 2.140 (December 30 2012) =head1 SEE ALSO diff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs index 27c611f..d7204e1 100644 --- a/dist/Data-Dumper/Dumper.xs +++ b/dist/Data-Dumper/Dumper.xs @@ -103,7 +103,7 @@ TOP: } if (isIDFIRST(*s)) { while (++s= e) Perl_croak(aTHX_ ident_too_long); - if (isALNUM(*s) + if (isWORDCHAR(*s) || (!UTF && isALPHANUMERIC_L1(*s))) /* UTF handled below */ { *d++ = *s++; @@ -9184,7 +9184,7 @@ S_scan_word(pTHX_ char *s, char *dest, STRLEN destlen, int allow_package, STRLEN *d++ = *s++; *d++ = *s++; } - else if (UTF && UTF8_IS_START(*s) && isALNUM_utf8((U8*)s)) { + else if (UTF && UTF8_IS_START(*s) && isWORDCHAR_utf8((U8*)s)) { char *t = s + UTF8SKIP(s); size_t len; while (UTF8_IS_CONTINUED(*t) && _is_utf8_mark((U8*)t)) @@ -9228,7 +9228,7 @@ S_scan_ident(pTHX_ char *s, const char *send, char *dest, STRLEN destlen, I32 ck for (;;) { if (d >= e) Perl_croak(aTHX_ ident_too_long); - if (isALNUM(*s)) /* UTF handled below */ + if (isWORDCHAR(*s)) /* UTF handled below */ *d++ = *s++; else if (*s == '\'' && isIDFIRST_lazy_if(s+1,UTF)) { *d++ = ':'; @@ -9239,7 +9239,7 @@ S_scan_ident(pTHX_ char *s, const char *send, char *dest, STRLEN destlen, I32 ck *d++ = *s++; *d++ = *s++; } - else if (UTF && UTF8_IS_START(*s) && isALNUM_utf8((U8*)s)) { + else if (UTF && UTF8_IS_START(*s) && isWORDCHAR_utf8((U8*)s)) { char *t = s + UTF8SKIP(s); while (UTF8_IS_CONTINUED(*t) && _is_utf8_mark((U8*)t)) t += UTF8SKIP(t); @@ -9312,7 +9312,7 @@ S_scan_ident(pTHX_ char *s, const char *send, char *dest, STRLEN destlen, I32 ck s = end; } else { - while ((isALNUM(*s) || *s == ':') && d < e) + while ((isWORDCHAR(*s) || *s == ':') && d < e) *d++ = *s++; if (d >= e) Perl_croak(aTHX_ ident_too_long); @@ -9338,11 +9338,11 @@ S_scan_ident(pTHX_ char *s, const char *send, char *dest, STRLEN destlen, I32 ck } /* Handle extended ${^Foo} variables * 1999-02-27 mjd-perl-patch@plover.com */ - else if (!isALNUM(*d) && !isPRINT(*d) /* isCTRL(d) */ - && isALNUM(*s)) + else if (!isWORDCHAR(*d) && !isPRINT(*d) /* isCTRL(d) */ + && isWORDCHAR(*s)) { d++; - while (isALNUM(*s) && d < e) { + while (isWORDCHAR(*s) && d < e) { *d++ = *s++; } if (d >= e) diff --git a/util.h b/util.h index 5f11289..ed133c4 100644 --- a/util.h +++ b/util.h @@ -13,7 +13,7 @@ (*(f) == '/' \ || (strchr(f,':') \ || ((*(f) == '[' || *(f) == '<') \ - && (isALNUM((f)[1]) || strchr("$-_]>",(f)[1]))))) + && (isWORDCHAR((f)[1]) || strchr("$-_]>",(f)[1]))))) #else /* !VMS */ # if defined(WIN32) || defined(__CYGWIN__) -- 1.8.3.1