summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-07-31 17:32:29 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-07-31 17:32:29 (GMT)
commit9df06f31b0103f7c3c7ab69c4dab6eb19021f50c (patch)
tree08e581c7bccd4d103c43b24f48a44c473ac69a15 /generic
parentcad03f83809878b3802167f7b8cd219012690cc8 (diff)
downloadtcl-9df06f31b0103f7c3c7ab69c4dab6eb19021f50c.zip
tcl-9df06f31b0103f7c3c7ab69c4dab6eb19021f50c.tar.gz
tcl-9df06f31b0103f7c3c7ab69c4dab6eb19021f50c.tar.bz2
nr-enabling [if]
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c4
-rw-r--r--generic/tclCmdIL.c18
-rw-r--r--generic/tclInt.h3
3 files changed, 18 insertions, 7 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 754d464..d65d32b 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.343 2008/07/31 15:42:06 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.344 2008/07/31 17:32:29 msofer Exp $
*/
#include "tclInt.h"
@@ -194,7 +194,7 @@ static const CmdInfo builtInCmds[] = {
{"foreach", Tcl_ForeachObjCmd, TclCompileForeachCmd, NULL, 1},
{"format", Tcl_FormatObjCmd, NULL, NULL, 1},
{"global", Tcl_GlobalObjCmd, TclCompileGlobalCmd, NULL, 1},
- {"if", Tcl_IfObjCmd, TclCompileIfCmd, NULL, 1},
+ {"if", Tcl_IfObjCmd, TclCompileIfCmd, TclNRIfObjCmd, 1},
{"incr", Tcl_IncrObjCmd, TclCompileIncrCmd, NULL, 1},
{"join", Tcl_JoinObjCmd, NULL, NULL, 1},
{"lappend", Tcl_LappendObjCmd, TclCompileLappendCmd, NULL, 1},
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index ab324de..89b8874 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.146 2008/07/23 20:49:52 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.147 2008/07/31 17:32:30 msofer Exp $
*/
#include "tclInt.h"
@@ -208,6 +208,16 @@ Tcl_IfObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
+ return Tcl_NRCallObjProc(interp, TclNRIfObjCmd, dummy, objc, objv);
+}
+
+int
+TclNRIfObjCmd(
+ ClientData dummy, /* Not used. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
+{
int thenScriptIndex = 0; /* "then" script to be evaled after syntax
* check. */
Interp *iPtr = (Interp *) interp;
@@ -267,7 +277,7 @@ Tcl_IfObjCmd(
* TIP #280. Make invoking context available to branch.
*/
- return TclEvalObjEx(interp, objv[thenScriptIndex], 0,
+ return TclNREvalObjEx(interp, objv[thenScriptIndex], 0,
iPtr->cmdFramePtr, thenScriptIndex);
}
return TCL_OK;
@@ -304,10 +314,10 @@ Tcl_IfObjCmd(
* TIP #280. Make invoking context available to branch/else.
*/
- return TclEvalObjEx(interp, objv[thenScriptIndex], 0,
+ return TclNREvalObjEx(interp, objv[thenScriptIndex], 0,
iPtr->cmdFramePtr, thenScriptIndex);
}
- return TclEvalObjEx(interp, objv[i], 0, iPtr->cmdFramePtr, i);
+ return TclNREvalObjEx(interp, objv[i], 0, iPtr->cmdFramePtr, i);
}
/*
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 6941f18..9ecea20 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclInt.h,v 1.383 2008/07/31 15:42:07 msofer Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.384 2008/07/31 17:32:30 msofer Exp $
*/
#ifndef _TCLINT
@@ -2529,6 +2529,7 @@ MODULE_SCOPE Tcl_ObjCmdProc TclNRNamespaceObjCmd;
MODULE_SCOPE Tcl_ObjCmdProc TclNRApplyObjCmd;
MODULE_SCOPE Tcl_ObjCmdProc TclNRUplevelObjCmd;
MODULE_SCOPE Tcl_ObjCmdProc TclNRCatchObjCmd;
+MODULE_SCOPE Tcl_ObjCmdProc TclNRIfObjCmd;
MODULE_SCOPE Tcl_ObjCmdProc TclTailcallObjCmd;
MODULE_SCOPE int TclNREvalCmd(Tcl_Interp * interp, Tcl_Obj * objPtr,