From 8e1d994ec7b4f06625c868eab4865e049ec0c94e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 1 Jun 2017 13:11:42 +0000 Subject: (experiment): Always compile ensembles. Result: 2 test failures in the "history" ensemble: ==== history-1.5 event option FAILED ==== Contents of test case: history e "* a*" ---- Test generated error; Return code was: 1 ---- Return code should have been one of: 0 2 ---- errorInfo: unknown subcommand "e": must be add, change, clear, event, info, keep, nextid, or redo while executing "history e {* a*}" invoked from within "history e "* a*"" ("uplevel" body line 1) invoked from within "uplevel 1 $script" ---- errorCode: TCL LOOKUP SUBCOMMAND e ==== history-1.5 FAILED ==== history-4.1 change option FAILED ==== Contents of test case: history event [expr {[history n]-1}] ---- Test generated error; Return code was: 1 ---- Return code should have been one of: 0 2 ---- errorInfo: unknown subcommand "n": must be add, change, clear, event, info, keep, nextid, or redo while executing "history n" invoked from within "history n" ("uplevel" body line 1) invoked from within "uplevel 1 $script" ---- errorCode: TCL LOOKUP SUBCOMMAND n ==== history-4.1 FAILED Test file error: unknown subcommand "ch": must be add, change, clear, event, info, keep, nextid, or redo while executing "history ch {Another test} -1" invoked from within "history ch "Another test" -1" invoked from within "if {[testConstraint history]} { history ch "Another test" -1 }" (file "tests/history.test" line 117) --- generic/tclEnsemble.c | 16 ++++------------ library/init.tcl | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 5b8deb6..9455999 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -55,12 +55,11 @@ enum EnsSubcmds { }; static const char *const ensembleCreateOptions[] = { - "-command", "-compile", "-map", "-parameters", "-prefixes", - "-subcommands", "-unknown", NULL + "-command", "-map", "-parameters", "-prefixes", "-subcommands", + "-unknown", NULL }; enum EnsCreateOpts { - CRT_CMD, CRT_COMPILE, CRT_MAP, CRT_PARAM, CRT_PREFIX, - CRT_SUBCMDS, CRT_UNKNOWN + CRT_CMD, CRT_MAP, CRT_PARAM, CRT_PREFIX, CRT_SUBCMDS, CRT_UNKNOWN }; static const char *const ensembleConfigOptions[] = { @@ -184,7 +183,6 @@ TclNamespaceEnsembleCmd( int permitPrefix = 1; Tcl_Obj *unknownObj = NULL; Tcl_Obj *paramObj = NULL; - int ensCompFlag = -1; /* * Check that we've got option-value pairs... [Bug 1558654] @@ -327,12 +325,6 @@ TclNamespaceEnsembleCmd( return TCL_ERROR; } continue; - case CRT_COMPILE: - if (Tcl_GetBooleanFromObj(interp, objv[1], - &ensCompFlag) != TCL_OK) { - return TCL_ERROR; - }; - continue; case CRT_UNKNOWN: if (TclListObjLength(interp, objv[1], &len) != TCL_OK) { if (allocatedMapFlag) { @@ -361,7 +353,7 @@ TclNamespaceEnsembleCmd( /* * Ensemble should be compiled if it has map (performance purposes) */ - if (ensCompFlag > 0 && mapObj != NULL) { + if (mapObj != NULL) { Tcl_SetEnsembleFlags(interp, token, ENSEMBLE_COMPILE); } diff --git a/library/init.tcl b/library/init.tcl index e500e3d..d2b0ae0 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -186,7 +186,7 @@ if {[interp issafe]} { } namespace inscope ::tcl::clock [list namespace ensemble create -command \ [uplevel 1 [list ::namespace origin [::lindex [info level 0] 0]]] \ - -map $cmdmap -compile 1] + -map $cmdmap] uplevel 1 [info level 0] } -- cgit v0.12