diff options
author | stanton <stanton@noemail.net> | 1999-06-24 03:27:56 (GMT) |
---|---|---|
committer | stanton <stanton@noemail.net> | 1999-06-24 03:27:56 (GMT) |
commit | 53cc932cd183c9787eaf500a3cf69898cbfaab6d (patch) | |
tree | 255e71bdabf736a3697e79ffdd09a91136ea7b33 /generic/tclUtf.c | |
parent | ab013996fb9a784c00cb592d73acfb20ac163840 (diff) | |
download | tcl-53cc932cd183c9787eaf500a3cf69898cbfaab6d.zip tcl-53cc932cd183c9787eaf500a3cf69898cbfaab6d.tar.gz tcl-53cc932cd183c9787eaf500a3cf69898cbfaab6d.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.
FossilOrigin-Name: 9d26b8335934c953a1668ca4972b9a0427413b2e
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r-- | generic/tclUtf.c | 12 |
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); } /* |