diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-05-11 09:14:42 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-05-11 09:14:42 (GMT) |
commit | d9bc6cbae2f78eb2883de1d9ef9a3131da80614f (patch) | |
tree | 2d4e66afa1a947c474d979c1d8b538104f98ad5e /tools | |
parent | 7bf3f83abd5bc0e24dbd3f02765b7e86d7ba1fa7 (diff) | |
download | tcl-d9bc6cbae2f78eb2883de1d9ef9a3131da80614f.zip tcl-d9bc6cbae2f78eb2883de1d9ef9a3131da80614f.tar.gz tcl-d9bc6cbae2f78eb2883de1d9ef9a3131da80614f.tar.bz2 |
Add emoji 11.0 to the set. Only active when compiled with TCL_UTF_MAX>3. Also prepare tooling for Unicode 11.0 (while being on it)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/uniClass.tcl | 6 | ||||
-rw-r--r-- | tools/uniParse.tcl | 17 |
2 files changed, 16 insertions, 7 deletions
diff --git a/tools/uniClass.tcl b/tools/uniClass.tcl index 9b4819d..86ec931 100644 --- a/tools/uniClass.tcl +++ b/tools/uniClass.tcl @@ -20,7 +20,7 @@ proc emitRange {first last} { set extranges 1 set numranges 0 set ranges [string trimright $ranges " \n\r\t,"] - append ranges "\n#if TCL_UTF_MAX > 4\n ," + append ranges "\n#if CHRBITS > 16\n ," } append ranges [format "{0x%x, 0x%x}, " \ $first $last] @@ -33,7 +33,7 @@ proc emitRange {first last} { set extchars 1 set numchars 0 set chars [string trimright $chars " \n\r\t,"] - append chars "\n#if TCL_UTF_MAX > 4\n ," + append chars "\n#if CHRBITS > 16\n ," } append chars [format "0x%x, " $first] incr numchars @@ -66,7 +66,7 @@ proc genTable {type} { for {set i 0} {$i <= 0x10ffff} {incr i} { if {$i == 0xd800} { # Skip surrogates - set i 0xdc00 + set i 0xe000 } if {[string is $type [format %c $i]]} { if {$i == ($last + 1)} { diff --git a/tools/uniParse.tcl b/tools/uniParse.tcl index e33b3c7..c712e62 100644 --- a/tools/uniParse.tcl +++ b/tools/uniParse.tcl @@ -272,6 +272,7 @@ static const unsigned char groupMap\[\] = {" * 100 = subtract delta for title/upper * 101 = sub delta for upper, sub 1 for title * 110 = sub delta for upper, add delta for lower + * 111 = subtract delta for upper * * Bits 8-31 Case delta: delta for case conversions. This should be the * highest field so we can easily sign extend. @@ -309,10 +310,14 @@ static const int groups\[\] = {" } } } elseif {$toupper} { - # subtract delta for upper, add delta for lower - set case 6 set delta $toupper - if {$tolower != $toupper} { + if {$tolower == $toupper} { + # subtract delta for upper, add delta for lower + set case 6 + } elseif {!$tolower} { + # subtract delta for upper + set case 7 + } else { error "New case conversion type needed: $toupper $tolower $totitle" } } elseif {$tolower} { @@ -396,7 +401,11 @@ enum { * Unicode character tables. */ -#define GetUniCharInfo(ch) (groups\[groupMap\[pageMap\[((ch) & 0xffff) >> OFFSET_BITS\] | ((ch) & ((1 << OFFSET_BITS)-1))\]\]) +#if TCL_UTF_MAX > 3 +# define GetUniCharInfo(ch) (groups\[groupMap\[pageMap\[((ch) & 0x1fffff) >> OFFSET_BITS\] | ((ch) & ((1 << OFFSET_BITS)-1))\]\]) +#else +# define GetUniCharInfo(ch) (groups\[groupMap\[pageMap\[((ch) & 0xffff) >> OFFSET_BITS\] | ((ch) & ((1 << OFFSET_BITS)-1))\]\]) +#endif " close $f |