summaryrefslogtreecommitdiffstats
path: root/generic/tclScan.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-04-03 06:05:13 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-04-03 06:05:13 (GMT)
commit2205a28b9e00ec29977d2b21e2f2bda3b77aaaf4 (patch)
tree261625244d376d9a2c2415ce97c8a93bdc2304f6 /generic/tclScan.c
parentfcf7bbf6ec9bc4d484960cf51acdab44bca2683a (diff)
downloadtcl-2205a28b9e00ec29977d2b21e2f2bda3b77aaaf4.zip
tcl-2205a28b9e00ec29977d2b21e2f2bda3b77aaaf4.tar.gz
tcl-2205a28b9e00ec29977d2b21e2f2bda3b77aaaf4.tar.bz2
More generation of error codes (namespace creation, path normalization,
pipeline creation, package handling, procedures, [scan] formats)
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);