Tcl Source Code

Check-in [82477e9d3a]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:For Tcl >= 8.7, always compile-in the extended Unicode tables, no matter the value of TCL_UTF_MAX. Do this in all Tcl versions, in order to prevent merge conflicts in future Unicode table updates.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-branch
Files: files | file ages | folders
SHA3-256: 82477e9d3a00b3f44d331956f6ef36297878b458694cb7560c3c363d5900294d
User & Date: jan.nijtmans 2019-03-17 22:16:41
Context
2019-03-18
22:14
enlarge a few small buffers, which could overflow using Unicode characters > /UFFFF. Eliminate some... check-in: 41c373ad8f user: jan.nijtmans tags: core-8-branch
20:07
Add 4 new encodings, and add documentation. check-in: 0ac59eb0c6 user: jan.nijtmans tags: utf-max
15:25
merge 8.7 check-in: 9c1a58d079 user: dgp tags: tip-445-api-fix
2019-03-17
22:17
Merge 8.7 check-in: 5bfbe84775 user: jan.nijtmans tags: trunk
22:16
For Tcl >= 8.7, always compile-in the extended Unicode tables, no matter the value of TCL_UTF_MAX. D... check-in: 82477e9d3a user: jan.nijtmans tags: core-8-branch
22:15
For Tcl >= 8.7, always compile-in the extended Unicode tables, no matter the value of TCL_UTF_MAX. D... check-in: 5c8a1f59fa user: jan.nijtmans tags: core-8-6-branch
2019-03-15
20:52
Eliminate usage of mp_isneg(), just check bignum->sign directly (as libtommath itself does) Make Tcl... check-in: 515a22d41d user: jan.nijtmans tags: core-8-branch
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/tclUniData.c.

   191    191       9920, 9920, 9920, 9920, 9920, 9920, 9920, 9920, 9920, 9920, 9920, 9920,
   192    192       9920, 9920, 9920, 9920, 9920, 1344, 1344, 1344, 1344, 1344, 1344, 1344,
   193    193       1344, 1344, 1344, 1344, 9952, 1344, 1344, 9984, 1824, 10016, 10048,
   194    194       10080, 1344, 1344, 10112, 10144, 1344, 1344, 1344, 1344, 1344, 1344,
   195    195       1344, 1344, 1344, 1344, 10176, 10208, 1344, 10240, 1344, 10272, 10304,
   196    196       10336, 10368, 10400, 10432, 1344, 1344, 1344, 10464, 10496, 64, 10528,
   197    197       10560, 10592, 4736, 10624, 10656
   198         -#if TCL_UTF_MAX > 3
          198  +#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6
   199    199       ,10688, 10720, 10752, 1824, 1344, 1344, 1344, 8288, 10784, 10816, 10848,
   200    200       10880, 10912, 10944, 10976, 11008, 1824, 1824, 1824, 1824, 9280, 1344,
   201    201       11040, 11072, 1344, 11104, 11136, 11168, 11200, 1344, 11232, 1824,
   202    202       11264, 11296, 11328, 1344, 11360, 11392, 11424, 11456, 1344, 11488,
   203    203       1344, 11520, 1824, 1824, 1824, 1824, 1344, 1344, 1344, 1344, 1344,
   204    204       1344, 1344, 1344, 1344, 7776, 4704, 10272, 1824, 1824, 1824, 1824,
   205    205       11552, 11584, 11616, 11648, 4736, 11680, 1824, 11712, 11744, 11776,
................................................................................
  1149   1149       5, 6, 3, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 92, 15, 15, 15,
  1150   1150       15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
  1151   1151       15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
  1152   1152       15, 15, 15, 15, 15, 15, 15, 15, 92, 92, 0, 0, 15, 15, 15, 15, 15, 15,
  1153   1153       0, 0, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 0, 0, 15,
  1154   1154       15, 15, 0, 0, 0, 4, 4, 7, 11, 14, 4, 4, 0, 14, 7, 7, 7, 7, 14, 14,
  1155   1155       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 14, 14, 0, 0
  1156         -#if TCL_UTF_MAX > 3
         1156  +#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6
  1157   1157       ,15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 15, 15,
  1158   1158       15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
  1159   1159       15, 15, 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
  1160   1160       15, 15, 15, 15, 15, 15, 15, 15, 0, 15, 15, 0, 15, 15, 15, 15, 15, 15,
  1161   1161       15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15,
  1162   1162       15, 15, 15, 15, 15, 15, 15, 0, 0, 3, 3, 3, 0, 0, 0, 0, 18, 18, 18,
  1163   1163       18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
................................................................................
  1609   1609       -2750143, -976319, -2746047, 2763650, 2762882, -2759615, -2751679,
  1610   1610       -2760383, -2760127, -2768575, 1859714, -9044927, -10823615, -12158,
  1611   1611       -10830783, -10833599, -10832575, -10830015, -10817983, -10824127,
  1612   1612       -10818751, 237633, -12223, -10830527, -9058239, 237698, 9949314,
  1613   1613       18, 17, 10305, 10370, 8769, 8834
  1614   1614   };
  1615   1615   
  1616         -#if TCL_UTF_MAX > 3
         1616  +#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6
  1617   1617   #   define UNICODE_OUT_OF_RANGE(ch) (((ch) & 0x1fffff) >= 0x2fa20)
  1618   1618   #else
  1619   1619   #   define UNICODE_OUT_OF_RANGE(ch) (((ch) & 0x1f0000) != 0)
  1620   1620   #endif
  1621   1621   
  1622   1622   /*
  1623   1623    * The following constants are used to determine the category of a
................................................................................
  1668   1668   #define GetDelta(info) ((info) >> 8)
  1669   1669   
  1670   1670   /*
  1671   1671    * This macro extracts the information about a character from the
  1672   1672    * Unicode character tables.
  1673   1673    */
  1674   1674   
  1675         -#if TCL_UTF_MAX > 3
         1675  +#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6
  1676   1676   #   define GetUniCharInfo(ch) (groups[groupMap[pageMap[((ch) & 0x1fffff) >> OFFSET_BITS] | ((ch) & ((1 << OFFSET_BITS)-1))]])
  1677   1677   #else
  1678   1678   #   define GetUniCharInfo(ch) (groups[groupMap[pageMap[((ch) & 0xffff) >> OFFSET_BITS] | ((ch) & ((1 << OFFSET_BITS)-1))]])
  1679   1679   #endif

Changes to tools/uniParse.tcl.

   208    208       set last [expr {[llength $pMap] - 1}]
   209    209       for {set i 0} {$i <= $last} {incr i} {
   210    210   	if {$i == [expr {0x10000 >> $shift}]} {
   211    211   	    set line [string trimright $line " \t,"]
   212    212   	    puts $f $line
   213    213   	    set lastpage [expr {[lindex $line end] >> $shift}]
   214    214   	    puts stdout "lastpage: $lastpage"
   215         -	    puts $f "#if TCL_UTF_MAX > 3"
          215  +	    puts $f "#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6"
   216    216   	    set line "    ,"
   217    217   	}
   218    218   	append line [lindex $pMap $i]
   219    219   	if {$i != $last} {
   220    220   	    append line ", "
   221    221   	}
   222    222   	if {[string length $line] > 70} {
................................................................................
   238    238       set line "    "
   239    239       set lasti [expr {[llength $pages] - 1}]
   240    240       for {set i 0} {$i <= $lasti} {incr i} {
   241    241   	set page [lindex $pages $i]
   242    242   	set lastj [expr {[llength $page] - 1}]
   243    243   	if {$i == ($lastpage + 1)} {
   244    244   	    puts $f [string trimright $line " \t,"]
   245         -	    puts $f "#if TCL_UTF_MAX > 3"
          245  +	    puts $f "#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6"
   246    246   	    set line "    ,"
   247    247   	}
   248    248   	for {set j 0} {$j <= $lastj} {incr j} {
   249    249   	    append line [lindex $page $j]
   250    250   	    if {$j != $lastj || $i != $lasti} {
   251    251   		append line ", "
   252    252   	    }
................................................................................
   338    338   	    puts $f [string trimright $line]
   339    339   	    set line "    "
   340    340   	}
   341    341       }
   342    342       puts $f $line
   343    343       puts -nonewline $f "};
   344    344   
   345         -#if TCL_UTF_MAX > 3
          345  +#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6
   346    346   #   define UNICODE_OUT_OF_RANGE(ch) (((ch) & 0x1fffff) >= [format 0x%x $next])
   347    347   #else
   348    348   #   define UNICODE_OUT_OF_RANGE(ch) (((ch) & 0x1f0000) != 0)
   349    349   #endif
   350    350   
   351    351   /*
   352    352    * The following constants are used to determine the category of a
................................................................................
   397    397   #define GetDelta(info) ((info) >> 8)
   398    398   
   399    399   /*
   400    400    * This macro extracts the information about a character from the
   401    401    * Unicode character tables.
   402    402    */
   403    403   
   404         -#if TCL_UTF_MAX > 3
          404  +#if TCL_UTF_MAX > 3 || TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6
   405    405   #   define GetUniCharInfo(ch) (groups\[groupMap\[pageMap\[((ch) & 0x1fffff) >> OFFSET_BITS\] | ((ch) & ((1 << OFFSET_BITS)-1))\]\])
   406    406   #else
   407    407   #   define GetUniCharInfo(ch) (groups\[groupMap\[pageMap\[((ch) & 0xffff) >> OFFSET_BITS\] | ((ch) & ((1 << OFFSET_BITS)-1))\]\])
   408    408   #endif
   409    409   "
   410    410   
   411    411       close $f
   412    412   }
   413    413   
   414    414   uni::main
   415    415   
   416    416   return