diff options
author | dgp <dgp@users.sourceforge.net> | 2004-10-01 03:10:35 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-10-01 03:10:35 (GMT) |
commit | e4934a0b0d10dcb22c615f1ff62a6e596b753455 (patch) | |
tree | f8b35fdda3fe85388bcbea559accd2e74916e7d3 /generic/tclTest.c | |
parent | 867b2ba591026b6f486b636329810e80b5069077 (diff) | |
download | tcl-e4934a0b0d10dcb22c615f1ff62a6e596b753455.zip tcl-e4934a0b0d10dcb22c615f1ff62a6e596b753455.tar.gz tcl-e4934a0b0d10dcb22c615f1ff62a6e596b753455.tar.bz2 |
* generic/tclBasic.c (Tcl_EvalObjEx): Removed the flag bit value
* generic/tclInt.h (Interp): USE_EVAL_DIRECT. It was used only
* generic/tcLTest.c (TestevalexObjCmd): in the testing command
* tests/parser.test (parse-9.2): [testevalex] and nothing in the
test suite made use of the capability it enabled.
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r-- | generic/tclTest.c | 45 |
1 files changed, 8 insertions, 37 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index 96d18d9..e05d5cd 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTest.c,v 1.83 2004/08/16 14:11:16 msofer Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.84 2004/10/01 03:10:36 dgp Exp $ */ #define TCL_TEST @@ -1927,31 +1927,14 @@ TestevalexObjCmd(dummy, interp, objc, objv) int objc; /* Number of arguments. */ Tcl_Obj *CONST objv[]; /* Argument objects. */ { - Interp *iPtr = (Interp *) interp; - int code, oldFlags, length, flags; - char *string; - - if (objc == 1) { - /* - * The command was invoked with no arguments, so just toggle - * the flag that determines whether we use Tcl_EvalEx. - */ - - if (iPtr->flags & USE_EVAL_DIRECT) { - iPtr->flags &= ~USE_EVAL_DIRECT; - Tcl_SetResult(interp, "disabling direct evaluation", TCL_STATIC); - } else { - iPtr->flags |= USE_EVAL_DIRECT; - Tcl_SetResult(interp, "enabling direct evaluation", TCL_STATIC); - } - return TCL_OK; - } + int length, flags; + char *script; flags = 0; if (objc == 3) { - string = Tcl_GetStringFromObj(objv[2], &length); - if (strcmp(string, "global") != 0) { - Tcl_AppendResult(interp, "bad value \"", string, + char *global = Tcl_GetStringFromObj(objv[2], &length); + if (strcmp(global, "global") != 0) { + Tcl_AppendResult(interp, "bad value \"", global, "\": must be global", (char *) NULL); return TCL_ERROR; } @@ -1960,21 +1943,9 @@ TestevalexObjCmd(dummy, interp, objc, objv) Tcl_WrongNumArgs(interp, 1, objv, "script ?global?"); return TCL_ERROR; } - Tcl_SetResult(interp, "xxx", TCL_STATIC); - /* - * Note, we have to set the USE_EVAL_DIRECT flag in the interpreter - * in addition to calling Tcl_EvalEx. This is needed so that even nested - * commands are evaluated directly. - */ - - oldFlags = iPtr->flags; - iPtr->flags |= USE_EVAL_DIRECT; - string = Tcl_GetStringFromObj(objv[1], &length); - code = Tcl_EvalEx(interp, string, length, flags); - iPtr->flags = (iPtr->flags & ~USE_EVAL_DIRECT) - | (oldFlags & USE_EVAL_DIRECT); - return code; + script = Tcl_GetStringFromObj(objv[1], &length); + return Tcl_EvalEx(interp, script, length, flags); } /* |