summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-27 15:25:19 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-27 15:25:19 (GMT)
commitc1b87fe734b40fcb3c7ec5c1c880727a4f553c6f (patch)
tree1276a34ee23f1f01f48d0b3e762e64dea4b1f20b
parentf41dac748006f0d68b74c28d0fb477f488305fd8 (diff)
parent4dd5bcda826982415475626e424d423e4f303ad8 (diff)
downloadtcl-c1b87fe734b40fcb3c7ec5c1c880727a4f553c6f.zip
tcl-c1b87fe734b40fcb3c7ec5c1c880727a4f553c6f.tar.gz
tcl-c1b87fe734b40fcb3c7ec5c1c880727a4f553c6f.tar.bz2
Merge 8.7
-rw-r--r--.travis.yml24
-rw-r--r--doc/library.n9
-rw-r--r--generic/tclExecute.c6
-rw-r--r--generic/tclInt.decls2
-rw-r--r--generic/tclInt.h2
-rw-r--r--generic/tclUtf.c14
-rw-r--r--tests/string.test2
7 files changed, 40 insertions, 19 deletions
diff --git a/.travis.yml b/.travis.yml
index 50eb658..6ab1540 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -139,9 +139,9 @@ matrix:
- BUILD_DIR=unix
- CFGOPT="--enable-symbols=mem"
# Testing on Mac, various styles
- - name: "macOS/Xcode 11.4/Shared"
+ - name: "macOS/Clang/Xcode 11.5/Shared"
os: osx
- osx_image: xcode11.4
+ osx_image: xcode11.5
env:
- BUILD_DIR=macosx
install: []
@@ -149,20 +149,28 @@ matrix:
- make all
# The styles=develop avoids some weird problems on OSX
- make test styles=develop
- - name: "macOS/Xcode 11.4/Shared/Unix-like"
+ - name: "macOS/Clang/Xcode 11.5/Shared/Unix-like"
os: osx
- osx_image: xcode11.4
+ osx_image: xcode11.5
env:
- BUILD_DIR=unix
+ - name: "macOS/Clang++/Xcode 11.5/Shared"
+ os: osx
+ osx_image: xcode11.5
+ env:
+ - BUILD_DIR=unix
+ - CFGOPT="CC=clang++ --enable-framework CFLAGS=-Dregister=dont+use+register CPPFLAGS=-D__private_extern__=extern"
+ script:
+ - make all tcltest
# Older MacOS versions
- - name: "macOS/Xcode 11/Shared"
+ - name: "macOS/Clang/Xcode 11/Shared"
os: osx
osx_image: xcode11
env:
- BUILD_DIR=macosx
install: []
script: *mactest
- - name: "macOS/Xcode 10/Shared"
+ - name: "macOS/Clang/Xcode 10/Shared"
os: osx
osx_image: xcode10.3
env:
@@ -173,7 +181,7 @@ matrix:
homebrew:
packages:
- libtommath
- - name: "macOS/Xcode 9/Shared"
+ - name: "macOS/Clang/Xcode 9/Shared"
os: osx
osx_image: xcode9.2
env:
@@ -184,7 +192,7 @@ matrix:
homebrew:
packages:
- libtommath
- - name: "macOS/Xcode 8/Shared"
+ - name: "macOS/Clang/Xcode 8/Shared"
os: osx
osx_image: xcode8.3
env:
diff --git a/doc/library.n b/doc/library.n
index 6f8f265..4dcd598 100644
--- a/doc/library.n
+++ b/doc/library.n
@@ -299,18 +299,13 @@ These variables are only used in the \fBtcl_endOfWord\fR,
This variable contains a regular expression that is used by routines
like \fBtcl_endOfWord\fR to identify whether a character is part of a
word or not. If the pattern matches a character, the character is
-considered to be a non-word character. On Windows platforms, spaces,
-tabs, and newlines are considered non-word characters. Under Unix,
-everything but numbers, letters and underscores are considered
-non-word characters.
+considered to be a non-word character. The default is "\\W".
.TP
\fBtcl_wordchars\fR
This variable contains a regular expression that is used by routines
like \fBtcl_endOfWord\fR to identify whether a character is part of a
word or not. If the pattern matches a character, the character is
-considered to be a word character. On Windows platforms, words are
-comprised of any character that is not a space, tab, or newline. Under
-Unix, words are comprised of numbers, letters or underscores.
+considered to be a word character. The default is "\\w".
.SH "SEE ALSO"
env(n), info(n), re_syntax(n)
.SH KEYWORDS
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 5708772..cc366e7 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5543,9 +5543,11 @@ TEBCresume(
ustring1 = Tcl_GetUnicodeFromObj(valuePtr, &length);
match = 1;
if (length > 0) {
+ int ch;
end = ustring1 + length;
- for (p=ustring1 ; p<end ; p++) {
- if (!tclStringClassTable[opnd].comparator(*p)) {
+ for (p=ustring1 ; p<end ; ) {
+ p += TclUniCharToUCS4(p, &ch);
+ if (!tclStringClassTable[opnd].comparator(ch)) {
match = 0;
break;
}
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 948ec26..8845359 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -893,7 +893,7 @@ declare 227 {
# Used to be needed for TclOO-extension; unneeded now that TclOO is in the
# core and NRE-enabled
# declare 228 {
-# int TclObjInterpProcCore(register Tcl_Interp *interp, Tcl_Obj *procNameObj,
+# int TclObjInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj,
# int skip, ProcErrorProc *errorProc)
# }
declare 229 {
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 03b2850..060ecf3 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -3251,11 +3251,13 @@ MODULE_SCOPE int TclUtfCasecmp(const char *cs, const char *ct);
MODULE_SCOPE int TclUtfCount(int ch);
#if TCL_UTF_MAX > 3
# define TclUtfToUCS4 Tcl_UtfToUniChar
+# define TclUniCharToUCS4(src, ptr) (*ptr = *(src),1)
# define TclUCS4Complete Tcl_UtfCharComplete
# define TclChar16Complete(src, length) (((unsigned)((unsigned char)*(src) - 0xF0) < 5) \
? ((length) >= 3) : Tcl_UtfCharComplete((src), (length)))
#else
MODULE_SCOPE int TclUtfToUCS4(const char *src, int *ucs4Ptr);
+ MODULE_SCOPE int TclUniCharToUCS4(const Tcl_UniChar *src, int *ucs4Ptr);
# define TclUCS4Complete(src, length) (((unsigned)((unsigned char)*(src) - 0xF0) < 5) \
? ((length) >= 4) : Tcl_UtfCharComplete((src), (length)))
# define TclChar16Complete Tcl_UtfCharComplete
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 2eb959e..11bde5c 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -2621,6 +2621,20 @@ TclUtfToUCS4(
/* Make use of the #undef Tcl_UtfToUniChar above, which already handles UCS4. */
return Tcl_UtfToUniChar(src, ucs4Ptr);
}
+
+int
+TclUniCharToUCS4(
+ const Tcl_UniChar *src, /* The Tcl_UniChar string. */
+ int *ucs4Ptr) /* Filled with the UCS4 codepoint represented
+ * by the Tcl_UniChar string. */
+{
+ if (((src[0] & 0xFC00) == 0xD800) && ((src[1] & 0xFC00) == 0xDC00)) {
+ *ucs4Ptr = (((src[0] & 0x3FF) << 10) | (src[01] & 0x3FF)) + 0x10000;
+ return 2;
+ }
+ *ucs4Ptr = src[0];
+ return 1;
+}
#endif
/*
diff --git a/tests/string.test b/tests/string.test
index 12821c0..55989e0 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -777,7 +777,7 @@ test string-6.80.$noComp {string is wordchar, true} {
run {string is wordchar abc_123}
} 1
test string-6.81.$noComp {string is wordchar, unicode true} {
- run {string is wordchar abc\xFCab\xDCAB\u5001}
+ run {string is wordchar abc\xFCab\xDCAB\u5001\U1D7CA}
} 1
test string-6.82.$noComp {string is wordchar, false} {
list [run {string is wordchar -fail var abcd.ef}] $var