summaryrefslogtreecommitdiffstats
path: root/generic/tclScan.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r--generic/tclScan.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c
index c862be4..68b8d21 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -331,6 +331,7 @@ ValidateFormat(
Tcl_SetResult(interp,
"cannot mix \"%\" and \"%n$\" conversion specifiers",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "MIXEDSPECTYPES", NULL);
goto error;
}
@@ -377,6 +378,7 @@ ValidateFormat(
Tcl_SetResult(interp,
"field width may not be specified in %c conversion",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADWIDTH", NULL);
goto error;
}
/*
@@ -390,6 +392,7 @@ ValidateFormat(
Tcl_AppendResult(interp,
"field size modifier may not be specified in %", buf,
" conversion", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADSIZE", NULL);
goto error;
}
/*
@@ -408,6 +411,7 @@ ValidateFormat(
if (flags & SCAN_BIG) {
Tcl_SetResult(interp,
"unsigned bignum scans are invalid", TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADUNSIGNED",NULL);
goto error;
}
break;
@@ -444,11 +448,13 @@ ValidateFormat(
badSet:
Tcl_SetResult(interp, "unmatched [ in format string",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BRACKET", NULL);
goto error;
default:
buf[Tcl_UniCharToUtf(ch, buf)] = '\0';
Tcl_AppendResult(interp, "bad scan conversion character \"", buf,
"\"", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "BADTYPE", NULL);
goto error;
}
if (!(flags & SCAN_SUPPRESS)) {
@@ -495,6 +501,7 @@ ValidateFormat(
Tcl_SetResult(interp,
"variable is assigned by multiple \"%n$\" conversion specifiers",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "POLYASSIGNED", NULL);
goto error;
} else if (!xpgSize && (nassign[i] == 0)) {
/*
@@ -505,6 +512,7 @@ ValidateFormat(
Tcl_SetResult(interp,
"variable is not assigned by any conversion specifiers",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "UNASSIGNED", NULL);
goto error;
}
}
@@ -516,10 +524,12 @@ ValidateFormat(
if (gotXpg) {
Tcl_SetResult(interp, "\"%n$\" argument index out of range",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "INDEXRANGE", NULL);
} else {
Tcl_SetResult(interp,
"different numbers of variable names and field specifiers",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "FORMAT", "FIELDVARMISMATCH", NULL);
}
error:
@@ -991,6 +1001,7 @@ Tcl_ScanObjCmd(
continue;
}
result++;
+#warning Why make your own error message? Why?
if (Tcl_ObjSetVar2(interp, objv[i+3], NULL, objs[i], 0) == NULL) {
Tcl_AppendResult(interp, "couldn't set variable \"",
TclGetString(objv[i+3]), "\"", NULL);