diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-01-31 12:42:32 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-01-31 12:42:32 (GMT) |
commit | 1143cd05200461754ddcbf7845a690710e87c1b5 (patch) | |
tree | 0f098f0ff2901bafc72a21fdc996c6b7fc327943 /tools | |
parent | 68bdb52eebdd917fa7a3283803b07a8b69ec61c2 (diff) | |
download | tcl-1143cd05200461754ddcbf7845a690710e87c1b5.zip tcl-1143cd05200461754ddcbf7845a690710e87c1b5.tar.gz tcl-1143cd05200461754ddcbf7845a690710e87c1b5.tar.bz2 |
Remove private characters from regexp control table, but add them back in [:cntrl:] class (so no change in regexp handling). Eliminated (size_t) type-casts.
This makes implementing more character-classes easier.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/uniClass.tcl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/uniClass.tcl b/tools/uniClass.tcl index 39fa28d..a4a58c2 100644 --- a/tools/uniClass.tcl +++ b/tools/uniClass.tcl @@ -63,11 +63,15 @@ proc genTable {type} { set extchars 0 set extranges 0 - for {set i 0} {$i <= 0x10FFFF} {incr i} { + for {set i 0} {$i <= 0xEFFFF} {incr i} { if {$i == 0xD800} { # Skip surrogates set i 0xE000 } + if {$i == 0xE000} { + # Skip private + set i 0xF900 + } if {[string is $type [format %c $i]]} { if {$i == ($last + 1)} { set last $i @@ -92,13 +96,13 @@ proc genTable {type} { } if {$ranges ne ""} { puts "static const crange ${type}RangeTable\[\] = {\n$ranges\n};\n" - puts "#define NUM_[string toupper $type]_RANGE (sizeof(${type}RangeTable)/sizeof(crange))\n" + puts "#define NUM_[string toupper $type]_RANGE ((int)(sizeof(${type}RangeTable)/sizeof(crange)))\n" } else { puts "/* no contiguous ranges of $type characters */\n" } if {$chars ne ""} { puts "static const chr ${type}CharTable\[\] = {\n$chars\n};\n" - puts "#define NUM_[string toupper $type]_CHAR (sizeof(${type}CharTable)/sizeof(chr))\n" + puts "#define NUM_[string toupper $type]_CHAR ((int)(sizeof(${type}CharTable)/sizeof(chr)))\n" } else { puts "/*\n * no singletons of $type characters.\n */\n" } |