Index: TODO =================================================================== diff -u -r7a6e32605412db15c6b9a1d61ce0a9dfd92bfbf6 -r3b75a92f67f6614a7ee823e4d37bc8724f9fb77d --- TODO (.../TODO) (revision 7a6e32605412db15c6b9a1d61ce0a9dfd92bfbf6) +++ TODO (.../TODO) (revision 3b75a92f67f6614a7ee823e4d37bc8724f9fb77d) @@ -1696,7 +1696,11 @@ - added functionality to show enumerated values in "info parametersyntax" +- extended regression test +- added expermimental code to avoid "variable :x" crash based + on shadowCommands, but this does not work, when varible is + bytecompiled. deactivated for now. TODO: @@ -1723,6 +1727,7 @@ possible realizations: -varscope instance|proc -scope object|method + -varscope instance|resolver * instance: within this method, all non-prefixed var names refer to instance variables; the method can use most Index: generic/nsfInt.h =================================================================== diff -u -r7a6e32605412db15c6b9a1d61ce0a9dfd92bfbf6 -r3b75a92f67f6614a7ee823e4d37bc8724f9fb77d --- generic/nsfInt.h (.../nsfInt.h) (revision 7a6e32605412db15c6b9a1d61ce0a9dfd92bfbf6) +++ generic/nsfInt.h (.../nsfInt.h) (revision 3b75a92f67f6614a7ee823e4d37bc8724f9fb77d) @@ -567,8 +567,9 @@ NSF_ALIAS, NSF_ARGS, NSF_CMD, NSF_FILTER, NSF_FORWARD, NSF_METHOD, NSF_OBJECT, NSF_SETTER, NSF_GUARD_OPTION, NSF___UNKNOWN__, - /* Patly redefined Tcl commands; leave them together at the end */ - NSF_EXPR, NSF_FORMAT, NSF_INFO, NSF_INFO_FRAME, NSF_INTERP, NSF_IS, NSF_RENAME, NSF_SUBST + /* Partly redefined Tcl commands; leave them together at the end */ + NSF_EXPR, NSF_FORMAT, NSF_INFO, NSF_INFO_FRAME, NSF_INTERP, NSF_IS, + NSF_RENAME, NSF_SUBST, NSF_VARIABLE } NsfGlobalNames; #if !defined(NSF_C) extern char *NsfGlobalStrings[]; @@ -587,7 +588,8 @@ "method", "object", "setter", "-guard", "__unknown__", /* tcl commands */ - "expr", "format", "info", "::tcl::info::frame", "interp", "::tcl::string::is", "rename", "subst", + "expr", "format", "info", "::tcl::info::frame", "interp", "::tcl::string::is", + "rename", "subst", "variable" }; #endif Index: generic/nsfShadow.c =================================================================== diff -u -rd1916d543ed083b100c8f9c48dd987d92c4bdb95 -r3b75a92f67f6614a7ee823e4d37bc8724f9fb77d --- generic/nsfShadow.c (.../nsfShadow.c) (revision d1916d543ed083b100c8f9c48dd987d92c4bdb95) +++ generic/nsfShadow.c (.../nsfShadow.c) (revision 3b75a92f67f6614a7ee823e4d37bc8724f9fb77d) @@ -107,7 +107,27 @@ return NsfCallCommand(interp, NSF_RENAME, objc, objv); } +#if 0 static int +Nsf_VariableObjCmd(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + int i; + Tcl_CallFrame *varFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(interp); + int frameFlags = varFramePtr ? Tcl_CallFrame_isProcCallFrame(varFramePtr) : 0; + + if (frameFlags & (FRAME_IS_NSF_METHOD|FRAME_IS_NSF_CMETHOD)) { + for (i=1 ; itclCommands != NULL); assert(initialized == 0); RUNTIME_STATE(interp)->tclCommands = - NEW_ARRAY(NsfShadowTclCommandInfo, NSF_SUBST - NSF_EXPR + 1); + NEW_ARRAY(NsfShadowTclCommandInfo, NSF_VARIABLE - NSF_EXPR + 1); /*fprintf(stderr, "+++ load tcl commands %d %d\n", load, initialized);*/ @@ -214,12 +234,16 @@ /* for the following commands, we have to add our own semantics */ rc |= NsfReplaceCommand(interp, NSF_INFO_FRAME, Nsf_InfoFrameObjCmd, initialized); rc |= NsfReplaceCommand(interp, NSF_RENAME, Nsf_RenameObjCmd, initialized); - + /*rc |= NsfReplaceCommand(interp, NSF_VARIABLE, Nsf_VariableObjCmd, initialized);*/ } else if (load == SHADOW_REFETCH) { - NsfReplaceCommandCheck(interp, NSF_RENAME, Nsf_RenameObjCmd); + NsfReplaceCommandCheck(interp, NSF_INFO_FRAME, Nsf_InfoFrameObjCmd); + NsfReplaceCommandCheck(interp, NSF_RENAME, Nsf_RenameObjCmd); + /*NsfReplaceCommandCheck(interp, NSF_VARIABLE, Nsf_VariableObjCmd);*/ } else { - NsfReplaceCommandCleanup(interp, NSF_RENAME); NsfReplaceCommandCleanup(interp, NSF_INFO_FRAME); + NsfReplaceCommandCleanup(interp, NSF_RENAME); + /*NsfReplaceCommandCleanup(interp, NSF_VARIABLE);*/ + FREE(NsfShadowTclCommandInfo*, RUNTIME_STATE(interp)->tclCommands); RUNTIME_STATE(interp)->tclCommands = NULL; }