summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-10-07 17:57:42 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-10-07 17:57:42 (GMT)
commitdbbfe378f614f96d7ab98c27bf89d733ba04d1b6 (patch)
tree683ba9bb560fe94aebd40fb15bb998a3033a2536 /generic
parent35bac8b2387c036a6ac3ac6c699ddde95f050062 (diff)
downloadtcl-dbbfe378f614f96d7ab98c27bf89d733ba04d1b6.zip
tcl-dbbfe378f614f96d7ab98c27bf89d733ba04d1b6.tar.gz
tcl-dbbfe378f614f96d7ab98c27bf89d733ba04d1b6.tar.bz2
* generic/tclBasic.c: Move [tailcall], [coroutine] and
* generic/tclCmdIL.c: [yield] out of ::tcl::unsupported * tests/info.test: and into global scope: TIPs #327 * tests/unsupported.test: and #328
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c37
-rw-r--r--generic/tclCmdIL.c3
-rw-r--r--generic/tclInt.h4
3 files changed, 20 insertions, 24 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 036707d..afddfb6 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.370 2008/10/03 00:01:35 dkf Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.371 2008/10/07 17:57:42 msofer Exp $
*/
#include "tclInt.h"
@@ -139,9 +139,6 @@ static Tcl_NRPostProc NRRunObjProc;
static Tcl_NRPostProc AtProcExitCleanup;
static Tcl_NRPostProc NRAtProcExitEval;
-static int InfoCoroutineCmd(ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-
/*
* The following structure define the commands in the Tcl core.
*/
@@ -216,7 +213,10 @@ static const CmdInfo builtInCmds[] = {
{"upvar", Tcl_UpvarObjCmd, TclCompileUpvarCmd, NULL, 1},
{"variable", Tcl_VariableObjCmd, TclCompileVariableCmd, NULL, 1},
{"while", Tcl_WhileObjCmd, TclCompileWhileCmd, TclNRWhileObjCmd, 1},
-
+
+ {"coroutine", NULL, NULL, TclNRCoroutineObjCmd, 1},
+ {"yield", NULL, NULL, TclNRYieldObjCmd, 1},
+
/*
* Commands in the OS-interface. Note that many of these are unsafe.
*/
@@ -712,7 +712,8 @@ Tcl_CreateInterp(void)
for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) {
if ((cmdInfoPtr->objProc == NULL)
- && (cmdInfoPtr->compileProc == NULL)) {
+ && (cmdInfoPtr->compileProc == NULL)
+ && (cmdInfoPtr->nreProc == NULL)) {
Tcl_Panic("builtin command with NULL object command proc and a NULL compile proc");
}
@@ -780,23 +781,16 @@ Tcl_CreateInterp(void)
Tcl_DisassembleObjCmd, NULL, NULL);
/*
- * Create unsupported commands for tailcall, coroutine and yield
- * Create unsupported commands for atProcExit and tailcall
+ * Create the 'tailcall' command an unsupported command for 'atProcExit'
*/
- Tcl_NRCreateCommand(interp, "::tcl::unsupported::atProcExit",
- /*objProc*/ NULL, TclNRAtProcExitObjCmd, INT2PTR(TCL_NR_ATEXIT_TYPE),
- NULL);
- Tcl_NRCreateCommand(interp, "::tcl::unsupported::tailcall",
+ Tcl_NRCreateCommand(interp, "tailcall",
/*objProc*/ NULL, TclNRAtProcExitObjCmd, INT2PTR(TCL_NR_TAILCALL_TYPE),
NULL);
- Tcl_NRCreateCommand(interp, "::tcl::unsupported::coroutine",
- /*objProc*/ NULL, TclNRCoroutineObjCmd, NULL, NULL);
- Tcl_NRCreateCommand(interp, "::tcl::unsupported::yield",
- /*objProc*/ NULL, TclNRYieldObjCmd, NULL, NULL);
- Tcl_NRCreateCommand(interp, "::tcl::unsupported::infoCoroutine",
- /*objProc*/ NULL, InfoCoroutineCmd, NULL, NULL);
+ Tcl_NRCreateCommand(interp, "::tcl::unsupported::atProcExit",
+ /*objProc*/ NULL, TclNRAtProcExitObjCmd, INT2PTR(TCL_NR_ATEXIT_TYPE),
+ NULL);
#ifdef USE_DTRACE
/*
@@ -5626,7 +5620,6 @@ Tcl_EvalObj(
{
return Tcl_EvalObjEx(interp, objPtr, 0);
}
-
#undef Tcl_GlobalEvalObj
int
Tcl_GlobalEvalObj(
@@ -8490,11 +8483,11 @@ TclNRCoroutineObjCmd(
}
/*
- * This belongs in the [info] ensemble later on
+ * This is used in the [info] ensemble
*/
-static int
-InfoCoroutineCmd(
+int
+TclInfoCoroutineCmd(
ClientData dummy,
Tcl_Interp *interp,
int objc,
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index cffc0dd..471560d 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.159 2008/10/04 18:06:48 dkf Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.160 2008/10/07 17:57:43 msofer Exp $
*/
#include "tclInt.h"
@@ -160,6 +160,7 @@ static const EnsembleImplMap defaultInfoMap[] = {
{"cmdcount", InfoCmdCountCmd, NULL},
{"commands", InfoCommandsCmd, NULL},
{"complete", InfoCompleteCmd, NULL},
+ {"coroutine", TclInfoCoroutineCmd, NULL},
{"default", InfoDefaultCmd, NULL},
{"exists", TclInfoExistsCmd, TclCompileInfoExistsCmd},
{"frame", InfoFrameCmd, NULL},
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 4704927..d33dd1d 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.401 2008/10/03 00:01:35 dkf Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.402 2008/10/07 17:57:43 msofer Exp $
*/
#ifndef _TCLINT
@@ -2663,6 +2663,8 @@ MODULE_SCOPE Tcl_Obj * TclIncrObjVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr,
Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr, int flags);
MODULE_SCOPE int TclInfoExistsCmd(ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
+MODULE_SCOPE int TclInfoCoroutineCmd(ClientData dummy, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE Tcl_Obj * TclInfoFrame(Tcl_Interp *interp, CmdFrame *framePtr);
MODULE_SCOPE int TclInfoGlobalsCmd(ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);