summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2006-11-28 22:20:27 (GMT)
committerandreas_kupries <akupries@shaw.ca>2006-11-28 22:20:27 (GMT)
commit2cd91050a0972e257b9bc1a320d996030f01ce5d (patch)
treec4542b66e173006f66825f5cfb1617a4fd9766e1 /generic/tclDictObj.c
parentde316a45d4f6dcf7815d5c199f65a0e636f20423 (diff)
downloadtcl-2cd91050a0972e257b9bc1a320d996030f01ce5d.zip
tcl-2cd91050a0972e257b9bc1a320d996030f01ce5d.tar.gz
tcl-2cd91050a0972e257b9bc1a320d996030f01ce5d.tar.bz2
* generic/tclBasic.c: TIP #280 implementation.
* generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompCmds.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclCompile.h: * generic/tclExecute.c: * generic/tclIOUtil.c: * generic/tclInt.h: * generic/tclInterp.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclProc.c: * tests/compile.test: * tests/info.test: * tests/platform.test: * tests/safe.test:
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 660a989..3a55669 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDictObj.c,v 1.45 2006/11/15 20:08:44 dgp Exp $
+ * RCS: @(#) $Id: tclDictObj.c,v 1.46 2006/11/28 22:20:28 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -2159,6 +2159,7 @@ DictForCmd(
int objc,
Tcl_Obj *CONST *objv)
{
+ Interp* iPtr = (Interp*) interp;
Tcl_Obj *scriptObj, *keyVarObj, *valueVarObj;
Tcl_Obj **varv, *keyObj, *valueObj;
Tcl_DictSearch search;
@@ -2178,9 +2179,9 @@ DictForCmd(
"must have exactly two variable names", -1));
return TCL_ERROR;
}
- keyVarObj = varv[0];
- valueVarObj = varv[1];
- scriptObj = objv[4];
+ keyVarObj = varv[0];
+ valueVarObj = varv[1];
+ scriptObj = objv[4];
if (Tcl_DictObjFirst(interp, objv[3], &search, &keyObj, &valueObj,
&done) != TCL_OK) {
@@ -2222,7 +2223,8 @@ DictForCmd(
break;
}
- result = Tcl_EvalObjEx(interp, scriptObj, 0);
+ /* TIP #280. Make invoking context available to loop body */
+ result = TclEvalObjEx(interp, scriptObj, 0, iPtr->cmdFramePtr, 4);
if (result == TCL_CONTINUE) {
result = TCL_OK;
} else if (result != TCL_OK) {
@@ -2395,6 +2397,7 @@ DictFilterCmd(
int objc,
Tcl_Obj *CONST *objv)
{
+ Interp* iPtr = (Interp*) interp;
static CONST char *filters[] = {
"key", "script", "value", NULL
};
@@ -2545,7 +2548,8 @@ DictFilterCmd(
goto abnormalResult;
}
- result = Tcl_EvalObjEx(interp, scriptObj, 0);
+ /* TIP #280. Make invoking context available to loop body */
+ result = TclEvalObjEx(interp, scriptObj, 0, iPtr->cmdFramePtr, 5);
switch (result) {
case TCL_OK:
boolObj = Tcl_GetObjResult(interp);
@@ -2761,6 +2765,7 @@ DictWithCmd(
int objc,
Tcl_Obj *CONST *objv)
{
+ Interp* iPtr = (Interp*) interp;
Tcl_Obj *dictPtr, *keysPtr, *keyPtr, *valPtr, **keyv, *leafPtr;
Tcl_DictSearch s;
Tcl_InterpState state;
@@ -2816,7 +2821,8 @@ DictWithCmd(
* Execute the body.
*/
- result = Tcl_EvalObjEx(interp, objv[objc-1], 0);
+ /* TIP #280. Make invoking context available to loop body */
+ result = TclEvalObjEx(interp, objv[objc-1], 0, iPtr->cmdFramePtr, objc-1);
if (result == TCL_ERROR) {
Tcl_AddErrorInfo(interp, "\n (body of \"dict with\")");
}