summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-02-11 22:10:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-02-11 22:10:29 (GMT)
commit1b9073eac4159dd3989896df68a3eeb28569747d (patch)
treec82a7e7028bbe42f7e46db1d5559600df8ad0fda
parentcb0dbff9befe300a3e54c1c8b09745e3ee2f323b (diff)
parentf24b479f0e69ef98b610a7fa06624c92fa406187 (diff)
downloadtcl-1b9073eac4159dd3989896df68a3eeb28569747d.zip
tcl-1b9073eac4159dd3989896df68a3eeb28569747d.tar.gz
tcl-1b9073eac4159dd3989896df68a3eeb28569747d.tar.bz2
Merge 8.7
-rw-r--r--doc/UniCharIsAlpha.317
-rw-r--r--doc/string.n7
-rw-r--r--generic/tcl.decls8
-rw-r--r--generic/tclCmdMZ.c7
-rw-r--r--generic/tclCompCmdsSZ.c8
-rw-r--r--generic/tclCompile.h1
-rw-r--r--generic/tclStubInit.c2
-rw-r--r--generic/tclUtf.c30
-rw-r--r--tests/string.test25
9 files changed, 16 insertions, 89 deletions
diff --git a/doc/UniCharIsAlpha.3 b/doc/UniCharIsAlpha.3
index 4ae4612..3ce402a 100644
--- a/doc/UniCharIsAlpha.3
+++ b/doc/UniCharIsAlpha.3
@@ -8,7 +8,7 @@
.so man.macros
.BS
.SH NAME
-Tcl_UniCharIsAlnum, Tcl_UniCharIsAlpha, Tcl_UniCharIsControl, Tcl_UniCharIsDigit, Tcl_UniCharIsGraph, Tcl_UniCharIsLower, Tcl_UniCharIsPrint, Tcl_UniCharIsPunct, Tcl_UniCharIsSpace, Tcl_UniCharIsUpper, Tcl_UniCharIsUnicode, Tcl_UniCharIsWordChar \- routines for classification of Tcl_UniChar characters
+Tcl_UniCharIsAlnum, Tcl_UniCharIsAlpha, Tcl_UniCharIsControl, Tcl_UniCharIsDigit, Tcl_UniCharIsGraph, Tcl_UniCharIsLower, Tcl_UniCharIsPrint, Tcl_UniCharIsPunct, Tcl_UniCharIsSpace, Tcl_UniCharIsUpper, Tcl_UniCharIsWordChar \- routines for classification of Tcl_UniChar characters
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -44,9 +44,6 @@ int
\fBTcl_UniCharIsUpper\fR(\fIch\fR)
.sp
int
-\fBTcl_UniCharIsUnicode\fR(\fIch\fR)
-.sp
-int
\fBTcl_UniCharIsWordChar\fR(\fIch\fR)
.fi
.SH ARGUMENTS
@@ -82,17 +79,11 @@ except space.
.PP
\fBTcl_UniCharIsPrint\fR tests if the character is a Unicode print character.
.PP
-\fBTcl_UniCharIsPunct\fR tests if the character is a Unicode punctuation
-character.
-.PP
-\fBTcl_UniCharIsSpace\fR tests if the character is a whitespace Unicode
-character.
+\fBTcl_UniCharIsPunct\fR tests if the character is a Unicode punctuation character.
.PP
-\fBTcl_UniCharIsUpper\fR tests if the character is an uppercase Unicode
-character.
+\fBTcl_UniCharIsSpace\fR tests if the character is a whitespace Unicode character.
.PP
-\fBTcl_UniCharIsUnicode\fR tests if the character is a Unicode character,
-not being a surrogate or noncharacter.
+\fBTcl_UniCharIsUpper\fR tests if the character is an uppercase Unicode character.
.PP
\fBTcl_UniCharIsWordChar\fR tests if the character is alphanumeric or
a connector punctuation mark.
diff --git a/doc/string.n b/doc/string.n
index 3b9af03..f07a591 100644
--- a/doc/string.n
+++ b/doc/string.n
@@ -181,13 +181,6 @@ zero width no-break space (U+feff) (=BOM).
.IP \fBtrue\fR 12
Any of the forms allowed to \fBTcl_GetBoolean\fR where the value is
true.
-.IP \fBunicode\fR 12
-Any Unicode character, except surrogates and noncharacters.
-.RS
-.PP
-\fIWarning: this option is under discussion and may be renamed or replaced
-by another solution within the Tcl 9.0 series.\fR
-.RE
.IP \fBupper\fR 12
Any upper case alphabet character in the Unicode character set.
.IP \fBwideinteger\fR 12
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 8e047d0..b8e1e1f 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2499,9 +2499,11 @@ declare 655 {
declare 656 {
const char *Tcl_UtfPrev(const char *src, const char *start)
}
-declare 657 {
- int Tcl_UniCharIsUnicode(int ch)
-}
+# Removed by TIP #652
+#
+#declare 657 {
+# int Tcl_UniCharIsUnicode(int ch)
+#}
# TIP 656
declare 658 {
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 38e04cb..2660ff1 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -1534,7 +1534,7 @@ StringIsCmd(
"boolean", "dict", "digit", "double",
"entier", "false", "graph", "integer",
"list", "lower", "print", "punct",
- "space", "true", "upper", "unicode",
+ "space", "true", "upper",
"wideinteger", "wordchar", "xdigit", NULL
};
enum isClassesEnum {
@@ -1542,7 +1542,7 @@ StringIsCmd(
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE,
STR_IS_ENTIER, STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT,
STR_IS_LIST, STR_IS_LOWER, STR_IS_PRINT, STR_IS_PUNCT,
- STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER, STR_IS_UNICODE,
+ STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER,
STR_IS_WIDE, STR_IS_WORD, STR_IS_XDIGIT
} index;
static const char *const isOptions[] = {
@@ -1871,9 +1871,6 @@ StringIsCmd(
case STR_IS_UPPER:
chcomp = Tcl_UniCharIsUpper;
break;
- case STR_IS_UNICODE:
- chcomp = Tcl_UniCharIsUnicode;
- break;
case STR_IS_WORD:
chcomp = Tcl_UniCharIsWordChar;
break;
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index 0a21226..d79b7b9 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -508,7 +508,7 @@ TclCompileStringIsCmd(
"boolean", "dict", "digit", "double",
"entier", "false", "graph", "integer",
"list", "lower", "print", "punct",
- "space", "true", "upper", "unicode",
+ "space", "true", "upper",
"wideinteger", "wordchar", "xdigit", NULL
};
enum isClassesEnum {
@@ -516,7 +516,7 @@ TclCompileStringIsCmd(
STR_IS_BOOL, STR_IS_DICT, STR_IS_DIGIT, STR_IS_DOUBLE,
STR_IS_ENTIER, STR_IS_FALSE, STR_IS_GRAPH, STR_IS_INT,
STR_IS_LIST, STR_IS_LOWER, STR_IS_PRINT, STR_IS_PUNCT,
- STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER, STR_IS_UNICODE,
+ STR_IS_SPACE, STR_IS_TRUE, STR_IS_UPPER,
STR_IS_WIDE, STR_IS_WORD, STR_IS_XDIGIT
} t;
int range, allowEmpty = 0, end;
@@ -609,9 +609,6 @@ TclCompileStringIsCmd(
case STR_IS_UPPER:
strClassType = STR_CLASS_UPPER;
goto compileStrClass;
- case STR_IS_UNICODE:
- strClassType = STR_CLASS_UNICODE;
- goto compileStrClass;
case STR_IS_WORD:
strClassType = STR_CLASS_WORD;
goto compileStrClass;
@@ -1423,7 +1420,6 @@ StringClassDesc const tclStringClassTable[] = {
{"upper", Tcl_UniCharIsUpper},
{"word", Tcl_UniCharIsWordChar},
{"xdigit", UniCharIsHexDigit},
- {"unicode", Tcl_UniCharIsUnicode},
{"", NULL}
};
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index 2ea2565..5bbbb8f 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -918,7 +918,6 @@ typedef enum InstStringClassType {
* punctuation) characters. */
STR_CLASS_XDIGIT, /* Characters that can be used as digits in
* hexadecimal numbers ([0-9A-Fa-f]). */
- STR_CLASS_UNICODE /* Unicode characters. */
} InstStringClassType;
typedef struct StringClassDesc {
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 34e8c27..9072796 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -1452,7 +1452,7 @@ const TclStubs tclStubs = {
Tcl_UtfCharComplete, /* 654 */
Tcl_UtfNext, /* 655 */
Tcl_UtfPrev, /* 656 */
- Tcl_UniCharIsUnicode, /* 657 */
+ 0, /* 657 */
Tcl_ExternalToUtfDStringEx, /* 658 */
Tcl_UtfToExternalDStringEx, /* 659 */
Tcl_AsyncMarkFromSignal, /* 660 */
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index ca4a166..9888772 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -2283,36 +2283,6 @@ Tcl_UniCharIsUpper(
/*
*----------------------------------------------------------------------
*
- * Tcl_UniCharIsUnicode --
- *
- * Test if a character is a Unicode character.
- *
- * Results:
- * Returns non-zero if character belongs to the Unicode set.
- *
- * Excluded are:
- * 1) All characters > U+10FFFF
- * 2) Surrogates U+D800 - U+DFFF
- * 3) Last 2 characters of each plane, so U+??FFFE and U+??FFFF
- * 4) The characters in the range U+FDD0 - U+FDEF
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-Tcl_UniCharIsUnicode(
- int ch) /* Unicode character to test. */
-{
- return ((unsigned int)ch <= 0x10FFFF) && ((ch & 0xFFF800) != 0xD800)
- && ((ch & 0xFFFE) != 0xFFFE) && ((unsigned int)(ch - 0xFDD0) >= 32);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* Tcl_UniCharIsWordChar --
*
* Test if a character is alphanumeric or a connector punctuation mark.
diff --git a/tests/string.test b/tests/string.test
index a232f1e..26cd8a7 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -537,10 +537,10 @@ test string-6.4.$noComp {string is, too many args} {
} {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"}}
test string-6.5.$noComp {string is, class check} {
list [catch {run {string is bogus str}} msg] $msg
-} {1 {bad class "bogus": must be alnum, alpha, ascii, control, boolean, dict, digit, double, entier, false, graph, integer, list, lower, print, punct, space, true, upper, unicode, wideinteger, wordchar, or xdigit}}
+} {1 {bad class "bogus": must be alnum, alpha, ascii, control, boolean, dict, digit, double, entier, false, graph, integer, list, lower, print, punct, space, true, upper, wideinteger, wordchar, or xdigit}}
test string-6.6.$noComp {string is, ambiguous class} {
list [catch {run {string is al str}} msg] $msg
-} {1 {ambiguous class "al": must be alnum, alpha, ascii, control, boolean, dict, digit, double, entier, false, graph, integer, list, lower, print, punct, space, true, upper, unicode, wideinteger, wordchar, or xdigit}}
+} {1 {ambiguous class "al": must be alnum, alpha, ascii, control, boolean, dict, digit, double, entier, false, graph, integer, list, lower, print, punct, space, true, upper, wideinteger, wordchar, or xdigit}}
test string-6.7.$noComp {string is alpha, all ok} {
run {string is alpha -strict -failindex var abc}
} 1
@@ -973,27 +973,6 @@ test string-6.130.1.$noComp {string is entier, false on bad octal} {
test string-6.131.$noComp {string is entier, false on bad hex} {
list [run {string is entier -fail var 0X12345611234123456123456562345612345612345612345612345612345612345612345612345612345345XYZ}] $var
} {0 88}
-test string-6.132.$noComp {string is unicode} {
- run {string is unicode \U10FFFD\uD7FF\uE000\uFDCF\uFDF0}
-} 1
-test string-6.133.$noComp {string is unicode, upper surrogate} {
- run {string is unicode \uD800}
-} 0
-test string-6.134.$noComp {string is unicode, lower surrogate} {
- run {string is unicode \uDFFF}
-} 0
-test string-6.135.$noComp {string is unicode, noncharacter} {
- run {string is unicode \uFFFE}
-} 0
-test string-6.136.$noComp {string is unicode, noncharacter} {
- run {string is unicode \uFFFF}
-} 0
-test string-6.137.$noComp {string is unicode, noncharacter} {
- run {string is unicode \uFDD0}
-} 0
-test string-6.138.$noComp {string is unicode, noncharacter} {
- run {string is unicode \uFDEF}
-} 0
test string-6.139.$noComp {string is integer, bug [76ad7aeba3]} {
run {string is integer 18446744073709551615}
} 1