summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-06-24 03:27:56 (GMT)
committerstanton <stanton>1999-06-24 03:27:56 (GMT)
commit79d36b8166d773a6f2740a59820c30748c102226 (patch)
tree255e71bdabf736a3697e79ffdd09a91136ea7b33 /generic/tclUtf.c
parent3497f9531e33550bfb1cec92c30b535497e86289 (diff)
downloadtcl-79d36b8166d773a6f2740a59820c30748c102226.zip
tcl-79d36b8166d773a6f2740a59820c30748c102226.tar.gz
tcl-79d36b8166d773a6f2740a59820c30748c102226.tar.bz2
* unix/Makefile.in: Changed install-doc to install-man.
* tools/uniParse.tcl: * tools/uniClass.tcl: * tools/README: * tests/string.test: * generic/regc_locale.c: * generic/tclUniData.c: * generic/tclUtf.c: * doc/string.n: Updated Unicode character tables to reflect latest Unicode 2.1 data. Also rationalized "regexp" and "string is" definitions of character classes.
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index c2abdae..9b21f4f 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUtf.c,v 1.8 1999/06/02 20:21:24 stanton Exp $
+ * RCS: @(#) $Id: tclUtf.c,v 1.9 1999/06/24 03:27:57 stanton Exp $
*/
#include "tclInt.h"
@@ -45,6 +45,11 @@
(1 << MATH_SYMBOL) | (1 << CURRENCY_SYMBOL) | \
(1 << MODIFIER_SYMBOL) | (1 << OTHER_SYMBOL))
+#define PUNCT_BITS ((1 << CONNECTOR_PUNCTUATION) | \
+ (1 << DASH_PUNCTUATION) | (1 << OPEN_PUNCTUATION) | \
+ (1 << CLOSE_PUNCTUATION) | (1 << INITIAL_QUOTE_PUNCTUATION) | \
+ (1 << FINAL_QUOTE_PUNCTUATION) | (1 << OTHER_PUNCTUATION))
+
/*
* Unicode characters less than this value are represented by themselves
* in UTF-8 strings.
@@ -1474,7 +1479,7 @@ Tcl_UniCharIsPrint(ch)
*
* Tcl_UniCharIsPunct --
*
- * Test if for any printing char that is neither space or an alnum.
+ * Test if a character is a Unicode punctuation character.
*
* Results:
* Returns non-zero if character is punct.
@@ -1490,8 +1495,7 @@ Tcl_UniCharIsPunct(ch)
int ch; /* Unicode character to test. */
{
register int category = (GetUniCharInfo(ch) & UNICODE_CATEGORY_MASK);
- return (((PRINT_BITS >> category) & 1) && ((unsigned char) ch != ' ')
- && !(((ALPHA_BITS | DIGIT_BITS) >> category) & 1));
+ return ((PUNCT_BITS >> category) & 1);
}
/*