Attachment "iswide.patch" to
ticket [940915ffff]
added by
kennykb
2004-04-28 02:31:45.
0000: 49 6e 64 65 78 3a 20 64 6f 63 2f 73 74 72 69 6e Index: doc/strin
0010: 67 2e 6e 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d g.n.============
0020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0050: 3d 3d 3d 3d 3d 3d 3d 0a 52 43 53 20 66 69 6c 65 =======.RCS file
0060: 3a 20 2f 63 76 73 72 6f 6f 74 2f 74 63 6c 2f 74 : /cvsroot/tcl/t
0070: 63 6c 2f 64 6f 63 2f 73 74 72 69 6e 67 2e 6e 2c cl/doc/string.n,
0080: 76 0a 72 65 74 72 69 65 76 69 6e 67 20 72 65 76 v.retrieving rev
0090: 69 73 69 6f 6e 20 31 2e 31 38 0a 64 69 66 66 20 ision 1.18.diff
00a0: 2d 75 20 2d 62 20 2d 72 31 2e 31 38 20 73 74 72 -u -b -r1.18 str
00b0: 69 6e 67 2e 6e 0a 2d 2d 2d 20 64 6f 63 2f 73 74 ing.n.--- doc/st
00c0: 72 69 6e 67 2e 6e 09 31 31 20 41 70 72 20 32 30 ring.n.11 Apr 20
00d0: 30 33 20 32 30 3a 35 30 3a 34 37 20 2d 30 30 30 03 20:50:47 -000
00e0: 30 09 31 2e 31 38 0a 2b 2b 2b 20 64 6f 63 2f 73 0.1.18.+++ doc/s
00f0: 74 72 69 6e 67 2e 6e 09 32 37 20 41 70 72 20 32 tring.n.27 Apr 2
0100: 30 30 34 20 31 39 3a 33 30 3a 33 35 20 2d 30 30 004 19:30:35 -00
0110: 30 30 0a 40 40 20 2d 39 35 2c 35 30 20 2b 39 35 00.@@ -95,50 +95
0120: 2c 35 36 20 40 40 0a 20 77 69 6c 6c 20 6e 6f 74 ,56 @@. will not
0130: 20 62 65 20 73 65 74 20 69 66 20 74 68 65 20 66 be set if the f
0140: 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 6e 73 20 unction returns
0150: 31 2e 20 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 1. The followin
0160: 67 20 63 68 61 72 61 63 74 65 72 0a 20 63 6c 61 g character. cla
0170: 73 73 65 73 20 61 72 65 20 72 65 63 6f 67 6e 69 sses are recogni
0180: 7a 65 64 20 28 74 68 65 20 63 6c 61 73 73 20 6e zed (the class n
0190: 61 6d 65 20 63 61 6e 20 62 65 20 61 62 62 72 65 ame can be abbre
01a0: 76 69 61 74 65 64 29 3a 0a 20 2e 52 53 0a 2d 2e viated):. .RS.-.
01b0: 49 50 20 5c 66 42 61 6c 6e 75 6d 5c 66 52 20 31 IP \fBalnum\fR 1
01c0: 30 0a 2b 2e 49 50 20 5c 66 42 61 6c 6e 75 6d 5c 0.+.IP \fBalnum\
01d0: 66 52 20 31 32 0a 20 41 6e 79 20 55 6e 69 63 6f fR 12. Any Unico
01e0: 64 65 20 61 6c 70 68 61 62 65 74 20 6f 72 20 64 de alphabet or d
01f0: 69 67 69 74 20 63 68 61 72 61 63 74 65 72 2e 0a igit character..
0200: 2d 2e 49 50 20 5c 66 42 61 6c 70 68 61 5c 66 52 -.IP \fBalpha\fR
0210: 20 31 30 0a 2b 2e 49 50 20 5c 66 42 61 6c 70 68 10.+.IP \fBalph
0220: 61 5c 66 52 20 31 32 0a 20 41 6e 79 20 55 6e 69 a\fR 12. Any Uni
0230: 63 6f 64 65 20 61 6c 70 68 61 62 65 74 20 63 68 code alphabet ch
0240: 61 72 61 63 74 65 72 2e 0a 2d 2e 49 50 20 5c 66 aracter..-.IP \f
0250: 42 61 73 63 69 69 5c 66 52 20 31 30 0a 2b 2e 49 Bascii\fR 10.+.I
0260: 50 20 5c 66 42 61 73 63 69 69 5c 66 52 20 31 32 P \fBascii\fR 12
0270: 0a 20 41 6e 79 20 63 68 61 72 61 63 74 65 72 20 . Any character
0280: 77 69 74 68 20 61 20 76 61 6c 75 65 20 6c 65 73 with a value les
0290: 73 20 74 68 61 6e 20 5c 5c 75 30 30 38 30 20 28 s than \\u0080 (
02a0: 74 68 6f 73 65 20 74 68 61 74 20 61 72 65 20 69 those that are i
02b0: 6e 20 74 68 65 0a 20 37 5c 2d 62 69 74 20 61 73 n the. 7\-bit as
02c0: 63 69 69 20 72 61 6e 67 65 29 2e 0a 2d 2e 49 50 cii range)..-.IP
02d0: 20 5c 66 42 62 6f 6f 6c 65 61 6e 5c 66 52 20 31 \fBboolean\fR 1
02e0: 30 0a 2b 2e 49 50 20 5c 66 42 62 6f 6f 6c 65 61 0.+.IP \fBboolea
02f0: 6e 5c 66 52 20 31 32 0a 20 41 6e 79 20 6f 66 20 n\fR 12. Any of
0300: 74 68 65 20 66 6f 72 6d 73 20 61 6c 6c 6f 77 65 the forms allowe
0310: 64 20 74 6f 20 5c 66 42 54 63 6c 5f 47 65 74 42 d to \fBTcl_GetB
0320: 6f 6f 6c 65 61 6e 5c 66 52 2e 0a 2d 2e 49 50 20 oolean\fR..-.IP
0330: 5c 66 42 63 6f 6e 74 72 6f 6c 5c 66 52 20 31 30 \fBcontrol\fR 10
0340: 0a 2b 2e 49 50 20 5c 66 42 63 6f 6e 74 72 6f 6c .+.IP \fBcontrol
0350: 5c 66 52 20 31 32 0a 20 41 6e 79 20 55 6e 69 63 \fR 12. Any Unic
0360: 6f 64 65 20 63 6f 6e 74 72 6f 6c 20 63 68 61 72 ode control char
0370: 61 63 74 65 72 2e 0a 2d 2e 49 50 20 5c 66 42 64 acter..-.IP \fBd
0380: 69 67 69 74 5c 66 52 20 31 30 0a 2b 2e 49 50 20 igit\fR 10.+.IP
0390: 5c 66 42 64 69 67 69 74 5c 66 52 20 31 32 0a 20 \fBdigit\fR 12.
03a0: 41 6e 79 20 55 6e 69 63 6f 64 65 20 64 69 67 69 Any Unicode digi
03b0: 74 20 63 68 61 72 61 63 74 65 72 2e 20 20 4e 6f t character. No
03c0: 74 65 20 74 68 61 74 20 74 68 69 73 20 69 6e 63 te that this inc
03d0: 6c 75 64 65 73 20 63 68 61 72 61 63 74 65 72 73 ludes characters
03e0: 0a 20 6f 75 74 73 69 64 65 20 6f 66 20 74 68 65 . outside of the
03f0: 20 5b 30 5c 2d 39 5d 20 72 61 6e 67 65 2e 0a 2d [0\-9] range..-
0400: 2e 49 50 20 5c 66 42 64 6f 75 62 6c 65 5c 66 52 .IP \fBdouble\fR
0410: 20 31 30 0a 2b 2e 49 50 20 5c 66 42 64 6f 75 62 10.+.IP \fBdoub
0420: 6c 65 5c 66 52 20 31 32 0a 20 41 6e 79 20 6f 66 le\fR 12. Any of
0430: 20 74 68 65 20 76 61 6c 69 64 20 66 6f 72 6d 73 the valid forms
0440: 20 66 6f 72 20 61 20 64 6f 75 62 6c 65 20 69 6e for a double in
0450: 20 54 63 6c 2c 20 77 69 74 68 20 6f 70 74 69 6f Tcl, with optio
0460: 6e 61 6c 20 73 75 72 72 6f 75 6e 64 69 6e 67 0a nal surrounding.
0470: 20 77 68 69 74 65 73 70 61 63 65 2e 20 20 49 6e whitespace. In
0480: 20 63 61 73 65 20 6f 66 20 75 6e 64 65 72 2f 6f case of under/o
0490: 76 65 72 66 6c 6f 77 20 69 6e 20 74 68 65 20 76 verflow in the v
04a0: 61 6c 75 65 2c 20 30 20 69 73 20 72 65 74 75 72 alue, 0 is retur
04b0: 6e 65 64 20 61 6e 64 0a 20 74 68 65 20 5c 66 49 ned and. the \fI
04c0: 76 61 72 6e 61 6d 65 5c 66 52 20 77 69 6c 6c 20 varname\fR will
04d0: 63 6f 6e 74 61 69 6e 20 5c 2d 31 2e 0a 2d 2e 49 contain \-1..-.I
04e0: 50 20 5c 66 42 66 61 6c 73 65 5c 66 52 20 31 30 P \fBfalse\fR 10
04f0: 0a 2b 2e 49 50 20 5c 66 42 66 61 6c 73 65 5c 66 .+.IP \fBfalse\f
0500: 52 20 31 32 0a 20 41 6e 79 20 6f 66 20 74 68 65 R 12. Any of the
0510: 20 66 6f 72 6d 73 20 61 6c 6c 6f 77 65 64 20 74 forms allowed t
0520: 6f 20 5c 66 42 54 63 6c 5f 47 65 74 42 6f 6f 6c o \fBTcl_GetBool
0530: 65 61 6e 5c 66 52 20 77 68 65 72 65 20 74 68 65 ean\fR where the
0540: 20 76 61 6c 75 65 20 69 73 0a 20 66 61 6c 73 65 value is. false
0550: 2e 0a 2d 2e 49 50 20 5c 66 42 67 72 61 70 68 5c ..-.IP \fBgraph\
0560: 66 52 20 31 30 0a 2b 2e 49 50 20 5c 66 42 67 72 fR 10.+.IP \fBgr
0570: 61 70 68 5c 66 52 20 31 32 0a 20 41 6e 79 20 55 aph\fR 12. Any U
0580: 6e 69 63 6f 64 65 20 70 72 69 6e 74 69 6e 67 20 nicode printing
0590: 63 68 61 72 61 63 74 65 72 2c 20 65 78 63 65 70 character, excep
05a0: 74 20 73 70 61 63 65 2e 0a 2d 2e 49 50 20 5c 66 t space..-.IP \f
05b0: 42 69 6e 74 65 67 65 72 5c 66 52 20 31 30 0a 2d Binteger\fR 10.-
05c0: 41 6e 79 20 6f 66 20 74 68 65 20 76 61 6c 69 64 Any of the valid
05d0: 20 66 6f 72 6d 73 20 66 6f 72 20 61 20 33 32 2d forms for a 32-
05e0: 62 69 74 20 69 6e 74 65 67 65 72 20 69 6e 20 54 bit integer in T
05f0: 63 6c 2c 20 77 69 74 68 20 6f 70 74 69 6f 6e 61 cl, with optiona
0600: 6c 0a 2b 2e 49 50 20 5c 66 42 69 6e 74 65 67 65 l.+.IP \fBintege
0610: 72 5c 66 52 20 31 32 0a 2b 41 6e 79 20 6f 66 20 r\fR 12.+Any of
0620: 74 68 65 20 76 61 6c 69 64 20 66 6f 72 6d 73 20 the valid forms
0630: 66 6f 72 20 61 6e 20 6f 72 64 69 6e 61 72 79 20 for an ordinary
0640: 69 6e 74 65 67 65 72 20 69 6e 20 54 63 6c 2c 20 integer in Tcl,
0650: 77 69 74 68 20 6f 70 74 69 6f 6e 61 6c 0a 20 73 with optional. s
0660: 75 72 72 6f 75 6e 64 69 6e 67 20 77 68 69 74 65 urrounding white
0670: 73 70 61 63 65 2e 20 20 49 6e 20 63 61 73 65 20 space. In case
0680: 6f 66 20 75 6e 64 65 72 2f 6f 76 65 72 66 6c 6f of under/overflo
0690: 77 20 69 6e 20 74 68 65 20 76 61 6c 75 65 2c 20 w in the value,
06a0: 30 20 69 73 0a 20 72 65 74 75 72 6e 65 64 20 61 0 is. returned a
06b0: 6e 64 20 74 68 65 20 5c 66 49 76 61 72 6e 61 6d nd the \fIvarnam
06c0: 65 5c 66 52 20 77 69 6c 6c 20 63 6f 6e 74 61 69 e\fR will contai
06d0: 6e 20 5c 2d 31 2e 0a 2d 2e 49 50 20 5c 66 42 6c n \-1..-.IP \fBl
06e0: 6f 77 65 72 5c 66 52 20 31 30 0a 2b 2e 49 50 20 ower\fR 10.+.IP
06f0: 5c 66 42 6c 6f 77 65 72 5c 66 52 20 31 32 0a 20 \fBlower\fR 12.
0700: 41 6e 79 20 55 6e 69 63 6f 64 65 20 6c 6f 77 65 Any Unicode lowe
0710: 72 20 63 61 73 65 20 61 6c 70 68 61 62 65 74 20 r case alphabet
0720: 63 68 61 72 61 63 74 65 72 2e 0a 2d 2e 49 50 20 character..-.IP
0730: 5c 66 42 70 72 69 6e 74 5c 66 52 20 31 30 0a 2b \fBprint\fR 10.+
0740: 2e 49 50 20 5c 66 42 70 72 69 6e 74 5c 66 52 20 .IP \fBprint\fR
0750: 31 32 0a 20 41 6e 79 20 55 6e 69 63 6f 64 65 20 12. Any Unicode
0760: 70 72 69 6e 74 69 6e 67 20 63 68 61 72 61 63 74 printing charact
0770: 65 72 2c 20 69 6e 63 6c 75 64 69 6e 67 20 73 70 er, including sp
0780: 61 63 65 2e 0a 2d 2e 49 50 20 5c 66 42 70 75 6e ace..-.IP \fBpun
0790: 63 74 5c 66 52 20 31 30 0a 2b 2e 49 50 20 5c 66 ct\fR 10.+.IP \f
07a0: 42 70 75 6e 63 74 5c 66 52 20 31 32 0a 20 41 6e Bpunct\fR 12. An
07b0: 79 20 55 6e 69 63 6f 64 65 20 70 75 6e 63 74 75 y Unicode punctu
07c0: 61 74 69 6f 6e 20 63 68 61 72 61 63 74 65 72 2e ation character.
07d0: 0a 2d 2e 49 50 20 5c 66 42 73 70 61 63 65 5c 66 .-.IP \fBspace\f
07e0: 52 20 31 30 0a 2b 2e 49 50 20 5c 66 42 73 70 61 R 10.+.IP \fBspa
07f0: 63 65 5c 66 52 20 31 32 0a 20 41 6e 79 20 55 6e ce\fR 12. Any Un
0800: 69 63 6f 64 65 20 73 70 61 63 65 20 63 68 61 72 icode space char
0810: 61 63 74 65 72 2e 0a 2d 2e 49 50 20 5c 66 42 74 acter..-.IP \fBt
0820: 72 75 65 5c 66 52 20 31 30 0a 2b 2e 49 50 20 5c rue\fR 10.+.IP \
0830: 66 42 74 72 75 65 5c 66 52 20 31 32 0a 20 41 6e fBtrue\fR 12. An
0840: 79 20 6f 66 20 74 68 65 20 66 6f 72 6d 73 20 61 y of the forms a
0850: 6c 6c 6f 77 65 64 20 74 6f 20 5c 66 42 54 63 6c llowed to \fBTcl
0860: 5f 47 65 74 42 6f 6f 6c 65 61 6e 5c 66 52 20 77 _GetBoolean\fR w
0870: 68 65 72 65 20 74 68 65 20 76 61 6c 75 65 20 69 here the value i
0880: 73 0a 20 74 72 75 65 2e 0a 2d 2e 49 50 20 5c 66 s. true..-.IP \f
0890: 42 75 70 70 65 72 5c 66 52 20 31 30 0a 2b 2e 49 Bupper\fR 10.+.I
08a0: 50 20 5c 66 42 75 70 70 65 72 5c 66 52 20 31 32 P \fBupper\fR 12
08b0: 0a 20 41 6e 79 20 75 70 70 65 72 20 63 61 73 65 . Any upper case
08c0: 20 61 6c 70 68 61 62 65 74 20 63 68 61 72 61 63 alphabet charac
08d0: 74 65 72 20 69 6e 20 74 68 65 20 55 6e 69 63 6f ter in the Unico
08e0: 64 65 20 63 68 61 72 61 63 74 65 72 20 73 65 74 de character set
08f0: 2e 0a 2d 2e 49 50 20 5c 66 42 77 6f 72 64 63 68 ..-.IP \fBwordch
0900: 61 72 5c 66 52 20 31 30 0a 2b 2e 56 53 20 38 2e ar\fR 10.+.VS 8.
0910: 35 0a 2b 2e 49 50 20 5c 66 42 77 69 64 65 69 6e 5.+.IP \fBwidein
0920: 74 65 67 65 72 5c 66 52 20 31 32 0a 2b 41 6e 79 teger\fR 12.+Any
0930: 20 6f 66 20 74 68 65 20 76 61 6c 69 64 20 66 6f of the valid fo
0940: 72 6d 73 20 66 6f 72 20 61 20 77 69 64 65 20 69 rms for a wide i
0950: 6e 74 65 67 65 72 20 69 6e 20 54 63 6c 2c 20 77 nteger in Tcl, w
0960: 69 74 68 20 6f 70 74 69 6f 6e 61 6c 0a 2b 73 75 ith optional.+su
0970: 72 72 6f 75 6e 64 69 6e 67 20 77 68 69 74 65 73 rrounding whites
0980: 70 61 63 65 2e 20 20 49 6e 20 63 61 73 65 20 6f pace. In case o
0990: 66 20 75 6e 64 65 72 2f 6f 76 65 72 66 6c 6f 77 f under/overflow
09a0: 20 69 6e 20 74 68 65 20 76 61 6c 75 65 2c 20 30 in the value, 0
09b0: 20 69 73 0a 2b 72 65 74 75 72 6e 65 64 20 61 6e is.+returned an
09c0: 64 20 74 68 65 20 5c 66 49 76 61 72 6e 61 6d 65 d the \fIvarname
09d0: 5c 66 52 20 77 69 6c 6c 20 63 6f 6e 74 61 69 6e \fR will contain
09e0: 20 5c 2d 31 2e 0a 2b 2e 56 45 0a 2b 2e 49 50 20 \-1..+.VE.+.IP
09f0: 5c 66 42 77 6f 72 64 63 68 61 72 5c 66 52 20 31 \fBwordchar\fR 1
0a00: 32 0a 20 41 6e 79 20 55 6e 69 63 6f 64 65 20 77 2. Any Unicode w
0a10: 6f 72 64 20 63 68 61 72 61 63 74 65 72 2e 20 20 ord character.
0a20: 54 68 61 74 20 69 73 20 61 6e 79 20 61 6c 70 68 That is any alph
0a30: 61 6e 75 6d 65 72 69 63 20 63 68 61 72 61 63 74 anumeric charact
0a40: 65 72 2c 20 61 6e 64 0a 20 61 6e 79 20 55 6e 69 er, and. any Uni
0a50: 63 6f 64 65 20 63 6f 6e 6e 65 63 74 6f 72 20 70 code connector p
0a60: 75 6e 63 74 75 61 74 69 6f 6e 20 63 68 61 72 61 unctuation chara
0a70: 63 74 65 72 73 20 28 65 2e 67 2e 20 75 6e 64 65 cters (e.g. unde
0a80: 72 73 63 6f 72 65 29 2e 0a 2d 2e 49 50 20 5c 66 rscore)..-.IP \f
0a90: 42 78 64 69 67 69 74 5c 66 52 20 31 30 0a 2b 2e Bxdigit\fR 10.+.
0aa0: 49 50 20 5c 66 42 78 64 69 67 69 74 5c 66 52 20 IP \fBxdigit\fR
0ab0: 31 32 0a 20 41 6e 79 20 68 65 78 61 64 65 63 69 12. Any hexadeci
0ac0: 6d 61 6c 20 64 69 67 69 74 20 63 68 61 72 61 63 mal digit charac
0ad0: 74 65 72 20 28 5b 30 5c 2d 39 41 5c 2d 46 61 5c ter ([0\-9A\-Fa\
0ae0: 2d 66 5d 29 2e 0a 20 2e 50 50 0a 20 49 6e 20 74 -f]).. .PP. In t
0af0: 68 65 20 63 61 73 65 20 6f 66 20 5c 66 42 62 6f he case of \fBbo
0b00: 6f 6c 65 61 6e 5c 66 52 2c 20 5c 66 42 74 72 75 olean\fR, \fBtru
0b10: 65 5c 66 52 20 61 6e 64 20 5c 66 42 66 61 6c 73 e\fR and \fBfals
0b20: 65 5c 66 52 2c 20 69 66 20 74 68 65 0a 49 6e 64 e\fR, if the.Ind
0b30: 65 78 3a 20 67 65 6e 65 72 69 63 2f 74 63 6c 43 ex: generic/tclC
0b40: 6d 64 4d 5a 2e 63 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d mdMZ.c.=========
0b50: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0b60: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0b70: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
0b80: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 52 43 53 20 66 ==========.RCS f
0b90: 69 6c 65 3a 20 2f 63 76 73 72 6f 6f 74 2f 74 63 ile: /cvsroot/tc
0ba0: 6c 2f 74 63 6c 2f 67 65 6e 65 72 69 63 2f 74 63 l/tcl/generic/tc
0bb0: 6c 43 6d 64 4d 5a 2e 63 2c 76 0a 72 65 74 72 69 lCmdMZ.c,v.retri
0bc0: 65 76 69 6e 67 20 72 65 76 69 73 69 6f 6e 20 31 eving revision 1
0bd0: 2e 31 30 31 0a 64 69 66 66 20 2d 75 20 2d 62 20 .101.diff -u -b
0be0: 2d 72 31 2e 31 30 31 20 74 63 6c 43 6d 64 4d 5a -r1.101 tclCmdMZ
0bf0: 2e 63 0a 2d 2d 2d 20 67 65 6e 65 72 69 63 2f 74 .c.--- generic/t
0c00: 63 6c 43 6d 64 4d 5a 2e 63 09 36 20 41 70 72 20 clCmdMZ.c.6 Apr
0c10: 32 30 30 34 20 32 32 3a 32 35 3a 34 39 20 2d 30 2004 22:25:49 -0
0c20: 30 30 30 09 31 2e 31 30 31 0a 2b 2b 2b 20 67 65 000.1.101.+++ ge
0c30: 6e 65 72 69 63 2f 74 63 6c 43 6d 64 4d 5a 2e 63 neric/tclCmdMZ.c
0c40: 09 32 37 20 41 70 72 20 32 30 30 34 20 31 39 3a .27 Apr 2004 19:
0c50: 33 30 3a 33 39 20 2d 30 30 30 30 0a 40 40 20 2d 30:39 -0000.@@ -
0c60: 31 35 36 39 2c 32 30 20 2b 31 35 36 39 2c 32 31 1569,20 +1569,21
0c70: 20 40 40 0a 20 09 20 20 20 20 69 6e 74 20 28 2a @@. . int (*
0c80: 63 68 63 6f 6d 70 29 5f 41 4e 53 49 5f 41 52 47 chcomp)_ANSI_ARG
0c90: 53 5f 28 28 69 6e 74 29 29 20 3d 20 4e 55 4c 4c S_((int)) = NULL
0ca0: 3b 20 0a 20 09 20 20 20 20 69 6e 74 20 69 2c 20 ; . . int i,
0cb0: 66 61 69 6c 61 74 20 3d 20 30 2c 20 72 65 73 75 failat = 0, resu
0cc0: 6c 74 20 3d 20 31 2c 20 73 74 72 69 63 74 20 3d lt = 1, strict =
0cd0: 20 30 3b 0a 20 09 20 20 20 20 54 63 6c 5f 4f 62 0;. . Tcl_Ob
0ce0: 6a 20 2a 6f 62 6a 50 74 72 2c 20 2a 66 61 69 6c j *objPtr, *fail
0cf0: 56 61 72 4f 62 6a 20 3d 20 4e 55 4c 4c 3b 0a 2b VarObj = NULL;.+
0d00: 09 20 20 20 20 54 63 6c 5f 57 69 64 65 49 6e 74 . Tcl_WideInt
0d10: 20 77 3b 0a 20 0a 20 09 20 20 20 20 73 74 61 74 w;. . . stat
0d20: 69 63 20 43 4f 4e 53 54 20 63 68 61 72 20 2a 69 ic CONST char *i
0d30: 73 4f 70 74 69 6f 6e 73 5b 5d 20 3d 20 7b 0a 20 sOptions[] = {.
0d40: 09 09 22 61 6c 6e 75 6d 22 2c 09 22 61 6c 70 68 .."alnum",."alph
0d50: 61 22 2c 09 22 61 73 63 69 69 22 2c 09 22 63 6f a",."ascii",."co
0d60: 6e 74 72 6f 6c 22 2c 0a 20 09 09 22 62 6f 6f 6c ntrol",. .."bool
0d70: 65 61 6e 22 2c 09 22 64 69 67 69 74 22 2c 09 22 ean",."digit",."
0d80: 64 6f 75 62 6c 65 22 2c 09 22 66 61 6c 73 65 22 double",."false"
0d90: 2c 0a 20 09 09 22 67 72 61 70 68 22 2c 09 22 69 ,. .."graph",."i
0da0: 6e 74 65 67 65 72 22 2c 09 22 6c 6f 77 65 72 22 nteger",."lower"
0db0: 2c 09 22 70 72 69 6e 74 22 2c 0a 20 09 09 22 70 ,."print",. .."p
0dc0: 75 6e 63 74 22 2c 09 22 73 70 61 63 65 22 2c 09 unct",."space",.
0dd0: 22 74 72 75 65 22 2c 09 09 22 75 70 70 65 72 22 "true",.."upper"
0de0: 2c 0a 2d 09 09 22 77 6f 72 64 63 68 61 72 22 2c ,.-.."wordchar",
0df0: 09 22 78 64 69 67 69 74 22 2c 09 28 63 68 61 72 ."xdigit",.(char
0e00: 20 2a 29 20 4e 55 4c 4c 0a 2b 09 09 22 77 69 64 *) NULL.+.."wid
0e10: 65 69 6e 74 65 67 65 72 22 2c 20 20 22 77 6f 72 einteger", "wor
0e20: 64 63 68 61 72 22 2c 09 22 78 64 69 67 69 74 22 dchar",."xdigit"
0e30: 2c 09 28 63 68 61 72 20 2a 29 20 4e 55 4c 4c 0a ,.(char *) NULL.
0e40: 20 09 20 20 20 20 7d 3b 0a 20 09 20 20 20 20 65 . };. . e
0e50: 6e 75 6d 20 69 73 4f 70 74 69 6f 6e 73 20 7b 0a num isOptions {.
0e60: 20 09 09 53 54 52 5f 49 53 5f 41 4c 4e 55 4d 2c ..STR_IS_ALNUM,
0e70: 09 53 54 52 5f 49 53 5f 41 4c 50 48 41 2c 09 53 .STR_IS_ALPHA,.S
0e80: 54 52 5f 49 53 5f 41 53 43 49 49 2c 09 53 54 52 TR_IS_ASCII,.STR
0e90: 5f 49 53 5f 43 4f 4e 54 52 4f 4c 2c 0a 20 09 09 _IS_CONTROL,. ..
0ea0: 53 54 52 5f 49 53 5f 42 4f 4f 4c 2c 09 53 54 52 STR_IS_BOOL,.STR
0eb0: 5f 49 53 5f 44 49 47 49 54 2c 09 53 54 52 5f 49 _IS_DIGIT,.STR_I
0ec0: 53 5f 44 4f 55 42 4c 45 2c 09 53 54 52 5f 49 53 S_DOUBLE,.STR_IS
0ed0: 5f 46 41 4c 53 45 2c 0a 20 09 09 53 54 52 5f 49 _FALSE,. ..STR_I
0ee0: 53 5f 47 52 41 50 48 2c 09 53 54 52 5f 49 53 5f S_GRAPH,.STR_IS_
0ef0: 49 4e 54 2c 09 53 54 52 5f 49 53 5f 4c 4f 57 45 INT,.STR_IS_LOWE
0f00: 52 2c 09 53 54 52 5f 49 53 5f 50 52 49 4e 54 2c R,.STR_IS_PRINT,
0f10: 0a 20 09 09 53 54 52 5f 49 53 5f 50 55 4e 43 54 . ..STR_IS_PUNCT
0f20: 2c 09 53 54 52 5f 49 53 5f 53 50 41 43 45 2c 09 ,.STR_IS_SPACE,.
0f30: 53 54 52 5f 49 53 5f 54 52 55 45 2c 09 53 54 52 STR_IS_TRUE,.STR
0f40: 5f 49 53 5f 55 50 50 45 52 2c 0a 2d 09 09 53 54 _IS_UPPER,.-..ST
0f50: 52 5f 49 53 5f 57 4f 52 44 2c 09 53 54 52 5f 49 R_IS_WORD,.STR_I
0f60: 53 5f 58 44 49 47 49 54 0a 2b 09 09 53 54 52 5f S_XDIGIT.+..STR_
0f70: 49 53 5f 57 49 44 45 2c 20 20 20 20 53 54 52 5f IS_WIDE, STR_
0f80: 49 53 5f 57 4f 52 44 2c 09 53 54 52 5f 49 53 5f IS_WORD,.STR_IS_
0f90: 58 44 49 47 49 54 0a 20 09 20 20 20 20 7d 3b 0a XDIGIT. . };.
0fa0: 20 0a 20 09 20 20 20 20 69 66 20 28 6f 62 6a 63 . . if (objc
0fb0: 20 3c 20 34 20 7c 7c 20 6f 62 6a 63 20 3e 20 37 < 4 || objc > 7
0fc0: 29 20 7b 0a 40 40 20 2d 31 38 30 33 2c 36 20 2b ) {.@@ -1803,6 +
0fd0: 31 38 30 34 2c 34 37 20 40 40 0a 20 09 09 63 61 1804,47 @@. ..ca
0fe0: 73 65 20 53 54 52 5f 49 53 5f 55 50 50 45 52 3a se STR_IS_UPPER:
0ff0: 0a 20 09 09 20 20 20 20 63 68 63 6f 6d 70 20 3d . .. chcomp =
1000: 20 54 63 6c 5f 55 6e 69 43 68 61 72 49 73 55 70 Tcl_UniCharIsUp
1010: 70 65 72 3b 0a 20 09 09 20 20 20 20 62 72 65 61 per;. .. brea
1020: 6b 3b 0a 2b 09 09 63 61 73 65 20 53 54 52 5f 49 k;.+..case STR_I
1030: 53 5f 57 49 44 45 3a 20 7b 0a 2b 09 09 20 20 20 S_WIDE: {.+..
1040: 20 63 68 61 72 20 2a 73 74 6f 70 3b 0a 2b 09 09 char *stop;.+..
1050: 20 20 20 20 6c 6f 6e 67 20 69 6e 74 20 6c 20 3d long int l =
1060: 20 30 3b 0a 2b 0a 2b 09 09 20 20 20 20 69 66 20 0;.+.+.. if
1070: 28 54 43 4c 5f 4f 4b 20 3d 3d 20 54 63 6c 5f 47 (TCL_OK == Tcl_G
1080: 65 74 57 69 64 65 49 6e 74 46 72 6f 6d 4f 62 6a etWideIntFromObj
1090: 28 4e 55 4c 4c 2c 20 6f 62 6a 50 74 72 2c 20 26 (NULL, objPtr, &
10a0: 77 29 29 20 7b 0a 2b 09 09 09 62 72 65 61 6b 3b w)) {.+...break;
10b0: 0a 2b 09 09 20 20 20 20 7d 0a 2b 09 09 20 20 20 .+.. }.+..
10c0: 20 2f 2a 0a 2b 09 09 20 20 20 20 20 2a 20 4c 69 /*.+.. * Li
10d0: 6b 65 20 53 54 52 5f 49 53 5f 44 4f 55 42 4c 45 ke STR_IS_DOUBLE
10e0: 2c 20 62 75 74 20 77 65 20 75 73 65 20 73 74 72 , but we use str
10f0: 74 6f 75 6c 2e 0a 2b 09 09 20 20 20 20 20 2a 20 toul..+.. *
1100: 53 69 6e 63 65 20 54 63 6c 5f 47 65 74 49 6e 74 Since Tcl_GetInt
1110: 46 72 6f 6d 4f 62 6a 20 61 6c 72 65 61 64 79 20 FromObj already
1120: 66 61 69 6c 65 64 2c 0a 2b 09 09 20 20 20 20 20 failed,.+..
1130: 2a 20 77 65 20 73 65 74 20 72 65 73 75 6c 74 20 * we set result
1140: 74 6f 20 30 2e 0a 2b 09 09 20 20 20 20 20 2a 2f to 0..+.. */
1150: 0a 2b 09 09 20 20 20 20 72 65 73 75 6c 74 20 3d .+.. result =
1160: 20 30 3b 0a 2b 09 09 20 20 20 20 65 72 72 6e 6f 0;.+.. errno
1170: 20 3d 20 30 3b 0a 2b 09 09 20 20 20 20 77 20 3d = 0;.+.. w =
1180: 20 73 74 72 74 6f 6c 6c 28 73 74 72 69 6e 67 31 strtoll(string1
1190: 2c 20 26 73 74 6f 70 2c 20 30 29 3b 20 2f 2a 20 , &stop, 0); /*
11a0: 49 4e 54 4c 3a 20 54 63 6c 20 73 6f 75 72 63 65 INTL: Tcl source
11b0: 2e 20 2a 2f 0a 2b 09 09 20 20 20 20 69 66 20 28 . */.+.. if (
11c0: 28 65 72 72 6e 6f 20 3d 3d 20 45 52 41 4e 47 45 (errno == ERANGE
11d0: 29 20 7c 7c 20 28 6c 20 3e 20 49 4e 54 5f 4d 41 ) || (l > INT_MA
11e0: 58 29 20 7c 7c 20 28 6c 20 3c 20 49 4e 54 5f 4d X) || (l < INT_M
11f0: 49 4e 29 29 20 7b 0a 2b 09 09 09 2f 2a 0a 2b 09 IN)) {.+.../*.+.
1200: 09 09 20 2a 20 69 66 20 28 65 72 72 6e 6f 20 3d .. * if (errno =
1210: 3d 20 45 52 41 4e 47 45 29 2c 20 74 68 65 6e 20 = ERANGE), then
1220: 69 74 20 77 61 73 20 61 6e 20 6f 76 65 72 2f 75 it was an over/u
1230: 6e 64 65 72 66 6c 6f 77 0a 2b 09 09 09 20 2a 20 nderflow.+... *
1240: 70 72 6f 62 6c 65 6d 2c 20 62 75 74 20 69 6e 20 problem, but in
1250: 74 68 69 73 20 6d 65 74 68 6f 64 2c 20 77 65 20 this method, we
1260: 6f 6e 6c 79 20 77 61 6e 74 20 74 6f 20 6b 6e 6f only want to kno
1270: 77 0a 2b 09 09 09 20 2a 20 79 65 73 20 6f 72 20 w.+... * yes or
1280: 6e 6f 2c 20 73 6f 20 62 61 64 20 66 6c 6f 77 20 no, so bad flow
1290: 72 65 74 75 72 6e 73 20 30 20 28 66 61 6c 73 65 returns 0 (false
12a0: 29 20 61 6e 64 20 73 65 74 73 0a 2b 09 09 09 20 ) and sets.+...
12b0: 2a 20 74 68 65 20 66 61 69 6c 56 61 72 4f 62 6a * the failVarObj
12c0: 20 74 6f 20 74 68 65 20 73 74 72 69 6e 67 20 6c to the string l
12d0: 65 6e 67 74 68 2e 0a 2b 09 09 09 20 2a 2f 0a 2b ength..+... */.+
12e0: 09 09 09 66 61 69 6c 61 74 20 3d 20 2d 31 3b 0a ...failat = -1;.
12f0: 2b 0a 2b 09 09 20 20 20 20 7d 20 65 6c 73 65 20 +.+.. } else
1300: 69 66 20 28 73 74 6f 70 20 3d 3d 20 73 74 72 69 if (stop == stri
1310: 6e 67 31 29 20 7b 0a 2b 09 09 09 2f 2a 0a 2b 09 ng1) {.+.../*.+.
1320: 09 09 20 2a 20 49 6e 20 74 68 69 73 20 63 61 73 .. * In this cas
1330: 65 2c 20 6e 6f 74 68 69 6e 67 20 6c 69 6b 65 20 e, nothing like
1340: 61 20 6e 75 6d 62 65 72 20 77 61 73 20 66 6f 75 a number was fou
1350: 6e 64 0a 2b 09 09 09 20 2a 2f 0a 2b 09 09 09 66 nd.+... */.+...f
1360: 61 69 6c 61 74 20 3d 20 30 3b 0a 2b 09 09 20 20 ailat = 0;.+..
1370: 20 20 7d 20 65 6c 73 65 20 7b 0a 2b 09 09 09 2f } else {.+.../
1380: 2a 0a 2b 09 09 09 20 2a 20 41 73 73 75 6d 65 20 *.+... * Assume
1390: 77 65 20 73 75 63 6b 65 64 20 75 70 20 6f 6e 65 we sucked up one
13a0: 20 63 68 61 72 20 70 65 72 20 62 79 74 65 0a 2b char per byte.+
13b0: 09 09 09 20 2a 20 61 6e 64 20 74 68 65 6e 20 77 ... * and then w
13c0: 65 20 67 6f 20 6f 6e 74 6f 20 53 50 41 43 45 2c e go onto SPACE,
13d0: 20 73 69 6e 63 65 20 77 65 20 61 72 65 0a 2b 09 since we are.+.
13e0: 09 09 20 2a 20 61 6c 6c 6f 77 65 64 20 74 72 61 .. * allowed tra
13f0: 69 6c 69 6e 67 20 77 68 69 74 65 73 70 61 63 65 iling whitespace
1400: 0a 2b 09 09 09 20 2a 2f 0a 2b 09 09 09 66 61 69 .+... */.+...fai
1410: 6c 61 74 20 3d 20 73 74 6f 70 20 2d 20 73 74 72 lat = stop - str
1420: 69 6e 67 31 3b 0a 2b 09 09 09 73 74 72 69 6e 67 ing1;.+...string
1430: 31 20 3d 20 73 74 6f 70 3b 0a 2b 09 09 09 63 68 1 = stop;.+...ch
1440: 63 6f 6d 70 20 3d 20 54 63 6c 5f 55 6e 69 43 68 comp = Tcl_UniCh
1450: 61 72 49 73 53 70 61 63 65 3b 0a 2b 09 09 20 20 arIsSpace;.+..
1460: 20 20 7d 0a 2b 09 09 20 20 20 20 62 72 65 61 6b }.+.. break
1470: 3b 0a 2b 09 09 7d 0a 20 09 09 63 61 73 65 20 53 ;.+..}. ..case S
1480: 54 52 5f 49 53 5f 57 4f 52 44 3a 0a 20 09 09 20 TR_IS_WORD:. ..
1490: 20 20 20 63 68 63 6f 6d 70 20 3d 20 54 63 6c 5f chcomp = Tcl_
14a0: 55 6e 69 43 68 61 72 49 73 57 6f 72 64 43 68 61 UniCharIsWordCha
14b0: 72 3b 0a 20 09 09 20 20 20 20 62 72 65 61 6b 3b r;. .. break;
14c0: 0a 49 6e 64 65 78 3a 20 74 65 73 74 73 2f 73 74 .Index: tests/st
14d0: 72 69 6e 67 2e 74 65 73 74 0a 3d 3d 3d 3d 3d 3d ring.test.======
14e0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
14f0: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1500: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ================
1510: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 52 43 =============.RC
1520: 53 20 66 69 6c 65 3a 20 2f 63 76 73 72 6f 6f 74 S file: /cvsroot
1530: 2f 74 63 6c 2f 74 63 6c 2f 74 65 73 74 73 2f 73 /tcl/tcl/tests/s
1540: 74 72 69 6e 67 2e 74 65 73 74 2c 76 0a 72 65 74 tring.test,v.ret
1550: 72 69 65 76 69 6e 67 20 72 65 76 69 73 69 6f 6e rieving revision
1560: 20 31 2e 33 39 0a 64 69 66 66 20 2d 75 20 2d 62 1.39.diff -u -b
1570: 20 2d 72 31 2e 33 39 20 73 74 72 69 6e 67 2e 74 -r1.39 string.t
1580: 65 73 74 0a 2d 2d 2d 20 74 65 73 74 73 2f 73 74 est.--- tests/st
1590: 72 69 6e 67 2e 74 65 73 74 09 34 20 4a 75 6c 20 ring.test.4 Jul
15a0: 32 30 30 33 20 31 30 3a 33 30 3a 32 37 20 2d 30 2003 10:30:27 -0
15b0: 30 30 30 09 31 2e 33 39 0a 2b 2b 2b 20 74 65 73 000.1.39.+++ tes
15c0: 74 73 2f 73 74 72 69 6e 67 2e 74 65 73 74 09 32 ts/string.test.2
15d0: 37 20 41 70 72 20 32 30 30 34 20 31 39 3a 33 30 7 Apr 2004 19:30
15e0: 3a 33 39 20 2d 30 30 30 30 0a 40 40 20 2d 33 31 :39 -0000.@@ -31
15f0: 31 2c 31 30 20 2b 33 31 31 2c 31 30 20 40 40 0a 1,10 +311,10 @@.
1600: 20 7d 20 7b 31 20 7b 77 72 6f 6e 67 20 23 20 61 } {1 {wrong # a
1610: 72 67 73 3a 20 73 68 6f 75 6c 64 20 62 65 20 22 rgs: should be "
1620: 73 74 72 69 6e 67 20 69 73 20 63 6c 61 73 73 20 string is class
1630: 3f 2d 73 74 72 69 63 74 3f 20 3f 2d 66 61 69 6c ?-strict? ?-fail
1640: 69 6e 64 65 78 20 76 61 72 3f 20 73 74 72 22 7d index var? str"}
1650: 7d 0a 20 74 65 73 74 20 73 74 72 69 6e 67 2d 36 }. test string-6
1660: 2e 35 20 7b 73 74 72 69 6e 67 20 69 73 2c 20 63 .5 {string is, c
1670: 6c 61 73 73 20 63 68 65 63 6b 7d 20 7b 0a 20 20 lass check} {.
1680: 20 20 20 6c 69 73 74 20 5b 63 61 74 63 68 20 7b list [catch {
1690: 73 74 72 69 6e 67 20 69 73 20 62 6f 67 75 73 20 string is bogus
16a0: 73 74 72 7d 20 6d 73 67 5d 20 24 6d 73 67 0a 2d str} msg] $msg.-
16b0: 7d 20 7b 31 20 7b 62 61 64 20 63 6c 61 73 73 20 } {1 {bad class
16c0: 22 62 6f 67 75 73 22 3a 20 6d 75 73 74 20 62 65 "bogus": must be
16d0: 20 61 6c 6e 75 6d 2c 20 61 6c 70 68 61 2c 20 61 alnum, alpha, a
16e0: 73 63 69 69 2c 20 63 6f 6e 74 72 6f 6c 2c 20 62 scii, control, b
16f0: 6f 6f 6c 65 61 6e 2c 20 64 69 67 69 74 2c 20 64 oolean, digit, d
1700: 6f 75 62 6c 65 2c 20 66 61 6c 73 65 2c 20 67 72 ouble, false, gr
1710: 61 70 68 2c 20 69 6e 74 65 67 65 72 2c 20 6c 6f aph, integer, lo
1720: 77 65 72 2c 20 70 72 69 6e 74 2c 20 70 75 6e 63 wer, print, punc
1730: 74 2c 20 73 70 61 63 65 2c 20 74 72 75 65 2c 20 t, space, true,
1740: 75 70 70 65 72 2c 20 77 6f 72 64 63 68 61 72 2c upper, wordchar,
1750: 20 6f 72 20 78 64 69 67 69 74 7d 7d 0a 2b 7d 20 or xdigit}}.+}
1760: 7b 31 20 7b 62 61 64 20 63 6c 61 73 73 20 22 62 {1 {bad class "b
1770: 6f 67 75 73 22 3a 20 6d 75 73 74 20 62 65 20 61 ogus": must be a
1780: 6c 6e 75 6d 2c 20 61 6c 70 68 61 2c 20 61 73 63 lnum, alpha, asc
1790: 69 69 2c 20 63 6f 6e 74 72 6f 6c 2c 20 62 6f 6f ii, control, boo
17a0: 6c 65 61 6e 2c 20 64 69 67 69 74 2c 20 64 6f 75 lean, digit, dou
17b0: 62 6c 65 2c 20 66 61 6c 73 65 2c 20 67 72 61 70 ble, false, grap
17c0: 68 2c 20 69 6e 74 65 67 65 72 2c 20 6c 6f 77 65 h, integer, lowe
17d0: 72 2c 20 70 72 69 6e 74 2c 20 70 75 6e 63 74 2c r, print, punct,
17e0: 20 73 70 61 63 65 2c 20 74 72 75 65 2c 20 75 70 space, true, up
17f0: 70 65 72 2c 20 77 69 64 65 69 6e 74 65 67 65 72 per, wideinteger
1800: 2c 20 77 6f 72 64 63 68 61 72 2c 20 6f 72 20 78 , wordchar, or x
1810: 64 69 67 69 74 7d 7d 0a 20 74 65 73 74 20 73 74 digit}}. test st
1820: 72 69 6e 67 2d 36 2e 36 20 7b 73 74 72 69 6e 67 ring-6.6 {string
1830: 20 69 73 2c 20 61 6d 62 69 67 75 6f 75 73 20 63 is, ambiguous c
1840: 6c 61 73 73 7d 20 7b 0a 20 20 20 20 20 6c 69 73 lass} {. lis
1850: 74 20 5b 63 61 74 63 68 20 7b 73 74 72 69 6e 67 t [catch {string
1860: 20 69 73 20 61 6c 20 73 74 72 7d 20 6d 73 67 5d is al str} msg]
1870: 20 24 6d 73 67 0a 2d 7d 20 7b 31 20 7b 61 6d 62 $msg.-} {1 {amb
1880: 69 67 75 6f 75 73 20 63 6c 61 73 73 20 22 61 6c iguous class "al
1890: 22 3a 20 6d 75 73 74 20 62 65 20 61 6c 6e 75 6d ": must be alnum
18a0: 2c 20 61 6c 70 68 61 2c 20 61 73 63 69 69 2c 20 , alpha, ascii,
18b0: 63 6f 6e 74 72 6f 6c 2c 20 62 6f 6f 6c 65 61 6e control, boolean
18c0: 2c 20 64 69 67 69 74 2c 20 64 6f 75 62 6c 65 2c , digit, double,
18d0: 20 66 61 6c 73 65 2c 20 67 72 61 70 68 2c 20 69 false, graph, i
18e0: 6e 74 65 67 65 72 2c 20 6c 6f 77 65 72 2c 20 70 nteger, lower, p
18f0: 72 69 6e 74 2c 20 70 75 6e 63 74 2c 20 73 70 61 rint, punct, spa
1900: 63 65 2c 20 74 72 75 65 2c 20 75 70 70 65 72 2c ce, true, upper,
1910: 20 77 6f 72 64 63 68 61 72 2c 20 6f 72 20 78 64 wordchar, or xd
1920: 69 67 69 74 7d 7d 0a 2b 7d 20 7b 31 20 7b 61 6d igit}}.+} {1 {am
1930: 62 69 67 75 6f 75 73 20 63 6c 61 73 73 20 22 61 biguous class "a
1940: 6c 22 3a 20 6d 75 73 74 20 62 65 20 61 6c 6e 75 l": must be alnu
1950: 6d 2c 20 61 6c 70 68 61 2c 20 61 73 63 69 69 2c m, alpha, ascii,
1960: 20 63 6f 6e 74 72 6f 6c 2c 20 62 6f 6f 6c 65 61 control, boolea
1970: 6e 2c 20 64 69 67 69 74 2c 20 64 6f 75 62 6c 65 n, digit, double
1980: 2c 20 66 61 6c 73 65 2c 20 67 72 61 70 68 2c 20 , false, graph,
1990: 69 6e 74 65 67 65 72 2c 20 6c 6f 77 65 72 2c 20 integer, lower,
19a0: 70 72 69 6e 74 2c 20 70 75 6e 63 74 2c 20 73 70 print, punct, sp
19b0: 61 63 65 2c 20 74 72 75 65 2c 20 75 70 70 65 72 ace, true, upper
19c0: 2c 20 77 69 64 65 69 6e 74 65 67 65 72 2c 20 77 , wideinteger, w
19d0: 6f 72 64 63 68 61 72 2c 20 6f 72 20 78 64 69 67 ordchar, or xdig
19e0: 69 74 7d 7d 0a 20 74 65 73 74 20 73 74 72 69 6e it}}. test strin
19f0: 67 2d 36 2e 37 20 7b 73 74 72 69 6e 67 20 69 73 g-6.7 {string is
1a00: 20 61 6c 70 68 61 2c 20 61 6c 6c 20 6f 6b 7d 20 alpha, all ok}
1a10: 7b 0a 20 20 20 20 20 73 74 72 69 6e 67 20 69 73 {. string is
1a20: 20 61 6c 70 68 61 20 2d 73 74 72 69 63 74 20 2d alpha -strict -
1a30: 66 61 69 6c 69 6e 64 65 78 20 76 61 72 20 61 62 failindex var ab
1a40: 63 0a 20 7d 20 31 0a 40 40 20 2d 36 31 34 2c 36 c. } 1.@@ -614,6
1a50: 20 2b 36 31 34 2c 35 31 20 40 40 0a 20 20 20 20 +614,51 @@.
1a60: 20 73 65 74 20 78 20 30 78 31 30 30 30 30 30 30 set x 0x1000000
1a70: 30 30 0a 20 20 20 20 20 6c 69 73 74 20 5b 73 74 00. list [st
1a80: 72 69 6e 67 20 69 73 20 69 6e 74 65 67 65 72 20 ring is integer
1a90: 2d 66 61 69 6c 69 6e 64 65 78 20 76 61 72 20 5b -failindex var [
1aa0: 65 78 70 72 20 7b 24 78 7d 5d 5d 20 24 76 61 72 expr {$x}]] $var
1ab0: 0a 20 7d 20 7b 30 20 2d 31 7d 0a 2b 74 65 73 74 . } {0 -1}.+test
1ac0: 20 73 74 72 69 6e 67 2d 36 2e 39 35 20 7b 73 74 string-6.95 {st
1ad0: 72 69 6e 67 20 69 73 20 77 69 64 65 69 6e 74 65 ring is wideinte
1ae0: 67 65 72 2c 20 74 72 75 65 7d 20 7b 0a 2b 20 20 ger, true} {.+
1af0: 20 20 73 74 72 69 6e 67 20 69 73 20 77 69 64 65 string is wide
1b00: 69 6e 74 65 67 65 72 20 2b 31 32 33 34 35 36 37 integer +1234567
1b10: 38 39 30 0a 2b 7d 20 31 0a 2b 74 65 73 74 20 73 890.+} 1.+test s
1b20: 74 72 69 6e 67 2d 36 2e 39 36 20 7b 73 74 72 69 tring-6.96 {stri
1b30: 6e 67 20 69 73 20 77 69 64 65 69 6e 74 65 67 65 ng is wideintege
1b40: 72 2c 20 74 72 75 65 20 6f 6e 20 74 79 70 65 7d r, true on type}
1b50: 20 7b 0a 2b 20 20 20 20 73 74 72 69 6e 67 20 69 {.+ string i
1b60: 73 20 77 69 64 65 69 6e 74 65 67 65 72 20 5b 65 s wideinteger [e
1b70: 78 70 72 20 77 69 64 65 28 35 30 2e 30 29 5d 0a xpr wide(50.0)].
1b80: 2b 7d 20 31 0a 2b 74 65 73 74 20 73 74 72 69 6e +} 1.+test strin
1b90: 67 2d 36 2e 39 37 20 7b 73 74 72 69 6e 67 20 69 g-6.97 {string i
1ba0: 73 20 77 69 64 65 69 6e 74 65 67 65 72 2c 20 74 s wideinteger, t
1bb0: 72 75 65 7d 20 7b 0a 2b 20 20 20 20 73 74 72 69 rue} {.+ stri
1bc0: 6e 67 20 69 73 20 77 69 64 65 69 6e 74 65 67 65 ng is wideintege
1bd0: 72 20 5b 6c 69 73 74 20 2d 31 30 5d 0a 2b 7d 20 r [list -10].+}
1be0: 31 0a 2b 74 65 73 74 20 73 74 72 69 6e 67 2d 36 1.+test string-6
1bf0: 2e 39 38 20 7b 73 74 72 69 6e 67 20 69 73 20 77 .98 {string is w
1c00: 69 64 65 69 6e 74 65 67 65 72 2c 20 74 72 75 65 ideinteger, true
1c10: 20 61 73 20 68 65 78 7d 20 7b 0a 2b 20 20 20 20 as hex} {.+
1c20: 73 74 72 69 6e 67 20 69 73 20 77 69 64 65 69 6e string is widein
1c30: 74 65 67 65 72 20 30 78 61 62 63 64 65 66 0a 2b teger 0xabcdef.+
1c40: 7d 20 31 0a 2b 74 65 73 74 20 73 74 72 69 6e 67 } 1.+test string
1c50: 2d 36 2e 39 39 20 7b 73 74 72 69 6e 67 20 69 73 -6.99 {string is
1c60: 20 77 69 64 65 69 6e 74 65 67 65 72 2c 20 74 72 wideinteger, tr
1c70: 75 65 20 61 73 20 6f 63 74 61 6c 7d 20 7b 0a 2b ue as octal} {.+
1c80: 20 20 20 20 73 74 72 69 6e 67 20 69 73 20 77 69 string is wi
1c90: 64 65 69 6e 74 65 67 65 72 20 30 31 32 33 34 35 deinteger 012345
1ca0: 36 0a 2b 7d 20 31 0a 2b 74 65 73 74 20 73 74 72 6.+} 1.+test str
1cb0: 69 6e 67 2d 36 2e 31 30 30 20 7b 73 74 72 69 6e ing-6.100 {strin
1cc0: 67 20 69 73 20 77 69 64 65 69 6e 74 65 67 65 72 g is wideinteger
1cd0: 2c 20 74 72 75 65 20 77 69 74 68 20 77 68 69 74 , true with whit
1ce0: 65 73 70 61 63 65 7d 20 7b 0a 2b 20 20 20 20 73 espace} {.+ s
1cf0: 74 72 69 6e 67 20 69 73 20 77 69 64 65 69 6e 74 tring is wideint
1d00: 65 67 65 72 20 22 20 20 5c 6e 31 32 33 34 5c 76 eger " \n1234\v
1d10: 22 0a 2b 7d 20 31 0a 2b 74 65 73 74 20 73 74 72 ".+} 1.+test str
1d20: 69 6e 67 2d 36 2e 31 30 31 20 7b 73 74 72 69 6e ing-6.101 {strin
1d30: 67 20 69 73 20 77 69 64 65 69 6e 74 65 67 65 72 g is wideinteger
1d40: 2c 20 66 61 6c 73 65 7d 20 7b 0a 2b 20 20 20 20 , false} {.+
1d50: 6c 69 73 74 20 5b 73 74 72 69 6e 67 20 69 73 20 list [string is
1d60: 77 69 64 65 69 6e 74 65 67 65 72 20 2d 66 61 69 wideinteger -fai
1d70: 6c 20 76 61 72 20 31 32 33 61 62 63 5d 20 24 76 l var 123abc] $v
1d80: 61 72 0a 2b 7d 20 7b 30 20 33 7d 0a 2b 74 65 73 ar.+} {0 3}.+tes
1d90: 74 20 73 74 72 69 6e 67 2d 36 2e 31 30 32 20 7b t string-6.102 {
1da0: 73 74 72 69 6e 67 20 69 73 20 77 69 64 65 69 6e string is widein
1db0: 74 65 67 65 72 2c 20 66 61 6c 73 65 20 6f 6e 20 teger, false on
1dc0: 6f 76 65 72 66 6c 6f 77 7d 20 7b 0a 2b 20 20 20 overflow} {.+
1dd0: 20 6c 69 73 74 20 5b 73 74 72 69 6e 67 20 69 73 list [string is
1de0: 20 77 69 64 65 69 6e 74 65 67 65 72 20 2d 66 61 wideinteger -fa
1df0: 69 6c 20 76 61 72 20 2b 5b 6c 61 72 67 65 73 74 il var +[largest
1e00: 5f 69 6e 74 5d 30 5d 20 24 76 61 72 0a 2b 7d 20 _int]0] $var.+}
1e10: 7b 30 20 2d 31 7d 0a 2b 74 65 73 74 20 73 74 72 {0 -1}.+test str
1e20: 69 6e 67 2d 36 2e 31 30 33 20 7b 73 74 72 69 6e ing-6.103 {strin
1e30: 67 20 69 73 20 77 69 64 65 69 6e 74 65 67 65 72 g is wideinteger
1e40: 2c 20 66 61 6c 73 65 7d 20 7b 0a 2b 20 20 20 20 , false} {.+
1e50: 6c 69 73 74 20 5b 73 74 72 69 6e 67 20 69 73 20 list [string is
1e60: 77 69 64 65 69 6e 74 65 67 65 72 20 2d 66 61 69 wideinteger -fai
1e70: 6c 20 76 61 72 20 5b 65 78 70 72 20 64 6f 75 62 l var [expr doub
1e80: 6c 65 28 31 29 5d 5d 20 24 76 61 72 0a 2b 7d 20 le(1)]] $var.+}
1e90: 7b 30 20 31 7d 0a 2b 74 65 73 74 20 73 74 72 69 {0 1}.+test stri
1ea0: 6e 67 2d 36 2e 31 30 34 20 7b 73 74 72 69 6e 67 ng-6.104 {string
1eb0: 20 69 73 20 77 69 64 65 69 6e 74 65 67 65 72 2c is wideinteger,
1ec0: 20 66 61 6c 73 65 7d 20 7b 0a 2b 20 20 20 20 6c false} {.+ l
1ed0: 69 73 74 20 5b 73 74 72 69 6e 67 20 69 73 20 77 ist [string is w
1ee0: 69 64 65 69 6e 74 65 67 65 72 20 2d 66 61 69 6c ideinteger -fail
1ef0: 20 76 61 72 20 22 20 20 20 20 22 5d 20 24 76 61 var " "] $va
1f00: 72 0a 2b 7d 20 7b 30 20 30 7d 0a 2b 74 65 73 74 r.+} {0 0}.+test
1f10: 20 73 74 72 69 6e 67 2d 36 2e 31 30 35 20 7b 73 string-6.105 {s
1f20: 74 72 69 6e 67 20 69 73 20 77 69 64 65 69 6e 74 tring is wideint
1f30: 65 67 65 72 2c 20 66 61 6c 73 65 20 6f 6e 20 62 eger, false on b
1f40: 61 64 20 6f 63 74 61 6c 7d 20 7b 0a 2b 20 20 20 ad octal} {.+
1f50: 20 6c 69 73 74 20 5b 73 74 72 69 6e 67 20 69 73 list [string is
1f60: 20 77 69 64 65 69 6e 74 65 67 65 72 20 2d 66 61 wideinteger -fa
1f70: 69 6c 20 76 61 72 20 30 33 36 39 36 33 5d 20 24 il var 036963] $
1f80: 76 61 72 0a 2b 7d 20 7b 30 20 33 7d 0a 2b 74 65 var.+} {0 3}.+te
1f90: 73 74 20 73 74 72 69 6e 67 2d 36 2e 31 30 36 20 st string-6.106
1fa0: 7b 73 74 72 69 6e 67 20 69 73 20 77 69 64 65 69 {string is widei
1fb0: 6e 74 65 67 65 72 2c 20 66 61 6c 73 65 20 6f 6e nteger, false on
1fc0: 20 62 61 64 20 68 65 78 7d 20 7b 0a 2b 20 20 20 bad hex} {.+
1fd0: 20 6c 69 73 74 20 5b 73 74 72 69 6e 67 20 69 73 list [string is
1fe0: 20 77 69 64 65 69 6e 74 65 67 65 72 20 2d 66 61 wideinteger -fa
1ff0: 69 6c 20 76 61 72 20 30 58 33 34 35 58 59 5a 5d il var 0X345XYZ]
2000: 20 24 76 61 72 0a 2b 7d 20 7b 30 20 35 7d 0a 2b $var.+} {0 5}.+
2010: 74 65 73 74 20 73 74 72 69 6e 67 2d 36 2e 31 30 test string-6.10
2020: 35 20 7b 73 74 72 69 6e 67 20 69 73 20 69 6e 74 5 {string is int
2030: 65 67 65 72 2c 20 62 61 64 20 69 6e 74 65 67 65 eger, bad intege
2040: 72 73 7d 20 7b 0a 2b 20 20 20 20 23 20 53 46 20 rs} {.+ # SF
2050: 62 75 67 20 23 36 33 34 38 35 36 0a 2b 20 20 20 bug #634856.+
2060: 20 73 65 74 20 72 65 73 75 6c 74 20 22 22 0a 2b set result "".+
2070: 20 20 20 20 73 65 74 20 6e 75 6d 62 65 72 73 20 set numbers
2080: 5b 6c 69 73 74 20 31 20 2b 31 20 2b 2b 31 20 2b [list 1 +1 ++1 +
2090: 2d 31 20 2d 2b 31 20 2d 31 20 2d 2d 31 20 22 2d -1 -+1 -1 --1 "-
20a0: 20 2b 31 22 5d 0a 2b 20 20 20 20 66 6f 72 65 61 +1"].+ forea
20b0: 63 68 20 6e 75 6d 20 24 6e 75 6d 62 65 72 73 20 ch num $numbers
20c0: 7b 0a 2b 09 6c 61 70 70 65 6e 64 20 72 65 73 75 {.+.lappend resu
20d0: 6c 74 20 5b 73 74 72 69 6e 67 20 69 73 20 77 69 lt [string is wi
20e0: 64 65 69 6e 74 65 67 65 72 20 2d 73 74 72 69 63 deinteger -stric
20f0: 74 20 24 6e 75 6d 5d 0a 2b 20 20 20 20 7d 0a 2b t $num].+ }.+
2100: 20 20 20 20 73 65 74 20 72 65 73 75 6c 74 0a 2b set result.+
2110: 7d 20 7b 31 20 31 20 30 20 30 20 30 20 31 20 30 } {1 1 0 0 0 1 0
2120: 20 30 7d 0a 20 0a 20 63 61 74 63 68 20 7b 72 65 0}. . catch {re
2130: 6e 61 6d 65 20 6c 61 72 67 65 73 74 5f 69 6e 74 name largest_int
2140: 20 7b 7d 7d 0a 20 0a 40 40 20 2d 31 33 34 33 2c {}}. .@@ -1343,
2150: 33 20 2b 31 33 38 38 2c 37 20 40 40 0a 20 23 20 3 +1388,7 @@. #
2160: 63 6c 65 61 6e 75 70 0a 20 3a 3a 74 63 6c 74 65 cleanup. ::tclte
2170: 73 74 3a 3a 63 6c 65 61 6e 75 70 54 65 73 74 73 st::cleanupTests
2180: 0a 20 72 65 74 75 72 6e 0a 2b 0a 2b 23 20 4c 6f . return.+.+# Lo
2190: 63 61 6c 20 56 61 72 69 61 62 6c 65 73 3a 0a 2b cal Variables:.+
21a0: 23 20 6d 6f 64 65 3a 20 74 63 6c 0a 2b 23 20 45 # mode: tcl.+# E
21b0: 6e 64 3a 0a 5c 20 4e 6f 20 6e 65 77 6c 69 6e 65 nd:.\ No newline
21c0: 20 61 74 20 65 6e 64 20 6f 66 20 66 69 6c 65 0a at end of file.