diff options
author | Kevin B Kenny <kennykb@acm.org> | 2010-10-20 01:50:18 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2010-10-20 01:50:18 (GMT) |
commit | ba272f699236d12685e8a297303f71d9fe87080f (patch) | |
tree | 012aca108d2e4e279dd830e7c202ea1add3fa5aa /tools | |
parent | 9fd96b030f9ba4e30d0631ffa6d020089d507a02 (diff) | |
download | tcl-ba272f699236d12685e8a297303f71d9fe87080f.zip tcl-ba272f699236d12685e8a297303f71d9fe87080f.tar.gz tcl-ba272f699236d12685e8a297303f71d9fe87080f.tar.bz2 |
merge
Diffstat (limited to 'tools')
-rw-r--r-- | tools/uniClass.tcl | 8 | ||||
-rw-r--r-- | tools/uniParse.tcl | 16 |
2 files changed, 14 insertions, 10 deletions
diff --git a/tools/uniClass.tcl b/tools/uniClass.tcl index 1840851..9a1bf13 100644 --- a/tools/uniClass.tcl +++ b/tools/uniClass.tcl @@ -65,16 +65,16 @@ proc genTable {type} { set ranges [string trimright $ranges "\t\n ,"] set chars [string trimright $chars "\t\n ,"] if {$ranges ne ""} { - puts "static crange ${type}RangeTable\[\] = {\n$ranges\n};\n" + puts "static const crange ${type}RangeTable\[\] = {\n$ranges\n};\n" puts "#define NUM_[string toupper $type]_RANGE (sizeof(${type}RangeTable)/sizeof(crange))\n" } else { puts "/* no contiguous ranges of $type characters */\n" } if {$chars ne ""} { - puts "static chr ${type}CharTable\[\] = {\n$chars\n};\n" + puts "static const chr ${type}CharTable\[\] = {\n$chars\n};\n" puts "#define NUM_[string toupper $type]_CHAR (sizeof(${type}CharTable)/sizeof(chr))\n" } else { - puts "/* no singletons of $type characters */\n" + puts "/*\n * no singletons of $type characters.\n */\n" } } @@ -94,7 +94,7 @@ foreach {type desc} { upper "uppercase characters" graph "unicode print characters excluding space" } { - puts "/* Unicode: $desc */\n" + puts "/*\n * Unicode: $desc.\n */\n" genTable $type } diff --git a/tools/uniParse.tcl b/tools/uniParse.tcl index 7560e6b..46ccce4 100644 --- a/tools/uniParse.tcl +++ b/tools/uniParse.tcl @@ -4,12 +4,12 @@ # corresponding tclUniData.c file with compressed character # data tables. The input to this program should be the latest # UnicodeData file from: -# ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData-Latest.txt +# ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt # # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: uniParse.tcl,v 1.6 2010/07/01 21:28:15 nijtmans Exp $ +# RCS: @(#) $Id: uniParse.tcl,v 1.6.2.1 2010/10/20 01:50:19 kennykb Exp $ namespace eval uni { @@ -116,7 +116,11 @@ proc uni::buildTables {data} { set items [split $line \;] - scan [lindex $items 0] %4x index + scan [lindex $items 0] %x index + if {$index > 0xFFFF} then { + # Ignore non-BMP characters, as long as Tcl doesn't support them + continue + } set index [format 0x%0.4x $index] set gIndex [getGroup [getValue $items $index]] @@ -209,7 +213,7 @@ proc uni::main {} { * to the same alternate page number. */ -static unsigned char pageMap\[\] = {" +static const unsigned short pageMap\[\] = {" set line " " set last [expr {[llength $pMap] - 1}] for {set i 0} {$i <= $last} {incr i} { @@ -231,7 +235,7 @@ static unsigned char pageMap\[\] = {" * set of character attributes. */ -static unsigned char groupMap\[\] = {" +static const unsigned char groupMap\[\] = {" set line " " set lasti [expr {[llength $pages] - 1}] for {set i 0} {$i <= $lasti} {incr i} { @@ -270,7 +274,7 @@ static unsigned char groupMap\[\] = {" * highest field so we can easily sign extend. */ -static int groups\[\] = {" +static const int groups\[\] = {" set line " " set last [expr {[llength $groups] - 1}] for {set i 0} {$i <= $last} {incr i} { |