summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/scan.n4
-rw-r--r--generic/tclCompile.c1
-rw-r--r--generic/tclScan.c6
-rw-r--r--tests/scan.test17
4 files changed, 21 insertions, 7 deletions
diff --git a/doc/scan.n b/doc/scan.n
index cc5ed79..738a470 100644
--- a/doc/scan.n
+++ b/doc/scan.n
@@ -99,7 +99,7 @@ The input substring must be an octal integer. It is read in and the
integer value is stored in the variable,
truncated as required by the size modifier value.
.TP
-\fBx\fR
+\fBx\fR or \fBX\fR
.
The input substring must be a hexadecimal integer.
It is read in and the integer value is stored in the variable,
@@ -140,7 +140,7 @@ substring may be a white-space character.
The input substring consists of all the characters up to the next
white-space character; the characters are copied to the variable.
.TP
-\fBe\fR or \fBf\fR or \fBg\fR
+\fBe\fR or \fBf\fR or \fBg\fR or \fBE\fR or \fBG\fR
.
The input substring must be a floating-point number consisting
of an optional sign, a string of decimal digits possibly
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index dcd74f1..3c8e4ef 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -4034,7 +4034,6 @@ TclEmitInvoke(
int savedStackDepth = envPtr->currStackDepth;
int savedExpandCount = envPtr->expandCount;
JumpFixup nonTrapFixup;
- ExceptionAux *exceptAux = envPtr->exceptAuxArrayPtr + loopRange;
if (auxBreakPtr != NULL) {
auxBreakPtr = envPtr->exceptAuxArrayPtr + breakRange;
diff --git a/generic/tclScan.c b/generic/tclScan.c
index ef7eedf..4dfc2d6 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -406,11 +406,14 @@ ValidateFormat(
*/
case 'd':
case 'e':
+ case 'E':
case 'f':
case 'g':
+ case 'G':
case 'i':
case 'o':
case 'x':
+ case 'X':
case 'b':
break;
case 'u':
@@ -743,6 +746,7 @@ Tcl_ScanObjCmd(
parseFlag |= TCL_PARSE_OCTAL_ONLY | TCL_PARSE_SCAN_PREFIXES;
break;
case 'x':
+ case 'X':
op = 'i';
parseFlag |= TCL_PARSE_HEXADECIMAL_ONLY;
break;
@@ -758,7 +762,9 @@ Tcl_ScanObjCmd(
case 'f':
case 'e':
+ case 'E':
case 'g':
+ case 'G':
op = 'f';
break;
diff --git a/tests/scan.test b/tests/scan.test
index ea0c500..b57b641 100644
--- a/tests/scan.test
+++ b/tests/scan.test
@@ -375,6 +375,12 @@ test scan-4.48 {Tcl_ScanObjCmd, float scanning} {
test scan-4.49 {Tcl_ScanObjCmd, float scanning} {
list [scan {.1 0.2 3.} {%e %f %g} x y z] $x $y $z
} {3 0.1 0.2 3.0}
+test scan-4.49-uc-1 {Tcl_ScanObjCmd, float scanning} {
+ list [scan {0.5*0.75} {%E%c%G} x y z] $x $y $z
+} {3 0.5 42 0.75}
+test scan-4.49-uc-2 {Tcl_ScanObjCmd, float scanning} {
+ list [scan {5e-1*75E-2} {%E%c%G} x y z] $x $y $z
+} {3 0.5 42 0.75}
test scan-4.50 {Tcl_ScanObjCmd, float scanning} {
list [scan {1234567890a} %f x] $x
} {1 1234567890.0}
@@ -450,6 +456,9 @@ test scan-4.63 {scanning of large and negative hex integers} {
list [scan $scanstring {%x %x %x} a b c] \
[expr { $a == -1 }] [expr { $b == $MIN_INT }] [expr { $c == $MAX_INT }]
} {3 1 1 1}
+test scan-4.64 {scanning of hex with %X} {
+ scan "123 abc f78" %X%X%X
+} {291 2748 3960}
test scan-5.1 {integer scanning} -setup {
set a {}; set b {}; set c {}; set d {}
@@ -626,14 +635,14 @@ test scan-8.4 {error conditions} -returnCodes error -body {
scan a %O x
} -result {bad scan conversion character "O"}
test scan-8.5 {error conditions} -returnCodes error -body {
- scan a %X x
-} -result {bad scan conversion character "X"}
+ scan a %B x
+} -result {bad scan conversion character "B"}
test scan-8.6 {error conditions} -returnCodes error -body {
scan a %F x
} -result {bad scan conversion character "F"}
test scan-8.7 {error conditions} -returnCodes error -body {
- scan a %E x
-} -result {bad scan conversion character "E"}
+ scan a %p x
+} -result {bad scan conversion character "p"}
test scan-8.8 {error conditions} -returnCodes error -body {
scan a "%d %d" a
} -result {different numbers of variable names and field specifiers}