summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdIL.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-11-14 23:05:00 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-11-14 23:05:00 (GMT)
commite9dca7fbd88ce6c7cc5afc264a2c667f5f0d98b6 (patch)
treed61de78a8293a7d2a188189329afca632e2de56d /generic/tclCmdIL.c
parent9bdde7aa4d7b94e1801005fcc63f1fe9953d216a (diff)
downloadtcl-e9dca7fbd88ce6c7cc5afc264a2c667f5f0d98b6.zip
tcl-e9dca7fbd88ce6c7cc5afc264a2c667f5f0d98b6.tar.gz
tcl-e9dca7fbd88ce6c7cc5afc264a2c667f5f0d98b6.tar.bz2
Compile [info exists] into bytecode. Includes new instructions to support it.
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r--generic/tclCmdIL.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index ba6febb..2647a4c 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.124 2007/11/11 19:32:14 msofer Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.125 2007/11/14 23:05:01 dkf Exp $
*/
#include "tclInt.h"
@@ -110,8 +110,6 @@ static int InfoCompleteCmd(ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[]);
static int InfoDefaultCmd(ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[]);
-static int InfoExistsCmd(ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
/* TIP #280 - New 'info' subcommand 'frame' */
static int InfoFrameCmd(ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[]);
@@ -161,7 +159,7 @@ static const struct {
{"commands", InfoCommandsCmd},
{"complete", InfoCompleteCmd},
{"default", InfoDefaultCmd},
- {"exists", InfoExistsCmd},
+ {"exists", TclInfoExistsCmd},
{"frame", InfoFrameCmd},
{"functions", InfoFunctionsCmd},
{"globals", TclInfoGlobalsCmd},
@@ -416,6 +414,13 @@ TclInitInfoCmd(
}
Tcl_SetEnsembleMappingDict(interp, ensemble, mapDict);
}
+
+ /*
+ * Enable compilation of the [info exists] subcommand.
+ */
+
+ ((Command *)ensemble)->compileProc = &TclCompileInfoCmd;
+
return ensemble;
}
@@ -990,7 +995,7 @@ InfoDefaultCmd(
/*
*----------------------------------------------------------------------
*
- * InfoExistsCmd --
+ * TclInfoExistsCmd --
*
* Called to implement the "info exists" command that determines whether
* a variable exists. Handles the following syntax:
@@ -1007,8 +1012,8 @@ InfoDefaultCmd(
*----------------------------------------------------------------------
*/
-static int
-InfoExistsCmd(
+int
+TclInfoExistsCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */