Tcl Source Code

Artifact [cbab160dab]
Login

Artifact cbab160dab87cf6d522050d402976883e05122b0:

Attachment "nop3.patch" to ticket [451441ffff] added by msofer 2001-08-17 00:43:33.
? patch419528.txt
? patch451200.txt
? patch219184.txt
? nop3.patch
? generic/tclCompCmds.c.new
Index: generic/tclBasic.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v
retrieving revision 1.34
diff -r1.34 tclBasic.c
461a462,469
>      * Add the tcl::nop command.
>      */
> 
>     cmdPtr = (Command *) Tcl_CreateObjCommand(interp, "::tcl::nop",
> 	    Tcl_NopObjCmd, (ClientData) NULL, NULL);
>     cmdPtr->compileProc = TclCompileNopCmd;
> 
>     /*
Index: generic/tclCmdMZ.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdMZ.c,v
retrieving revision 1.43
diff -r1.43 tclCmdMZ.c
82a83,109
>  * Tcl_NopObjCmd --
>  *
>  *	This procedure is invoked to process the "tcl::nop" Tcl command.
>  *	See the user documentation for details on what it does.
>  *
>  * Results:
>  *	A standard Tcl result.
>  *
>  * Side effects:
>  *	See the user documentation.
>  *
>  *----------------------------------------------------------------------
>  */
> 
> int
> Tcl_NopObjCmd(dummy, interp, objc, objv)
>     ClientData dummy;			/* Not used. */
>     Tcl_Interp *interp;			/* Current interpreter. */
>     int objc;				/* Number of arguments. */
>     Tcl_Obj *CONST objv[];		/* Argument objects. */
> {
>     return TCL_OK;
> }
> 
> /*
>  *----------------------------------------------------------------------
>  *
Index: generic/tclCompCmds.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCompCmds.c,v
retrieving revision 1.9
diff -r1.9 tclCompCmds.c
1869a1870,1911
>  * TclCompileNopCmd --
>  *
>  *	Procedure called to compile the "tcl::nop" command.
>  *
>  * Results:
>  *	The return value is TCL_OK, indicating successful compilation.
>  *
>  *	envPtr->maxStackDepth is updated with the maximum number of stack
>  *	elements needed to execute the command.
>  *
>  * Side effects:
>  *	Instructions are added to envPtr to execute the "tcl::nop" command
>  *	at runtime.
>  *
>  *----------------------------------------------------------------------
>  */
> 
> int
> TclCompileNopCmd(interp, parsePtr, envPtr)
>     Tcl_Interp *interp;         /* Used for error reporting. */
>     Tcl_Parse *parsePtr;        /* Points to a parse structure for the
>                                  * command created by Tcl_ParseCommand. */
>     CompileEnv *envPtr;         /* Holds resulting instructions. */
> {
>     Tcl_Token *tokenPtr;
>     int i;
> 
>     tokenPtr = parsePtr->tokenPtr;
>     for(i = 1; i < parsePtr->numWords; i++) {
> 	tokenPtr = tokenPtr + tokenPtr->numComponents + 1;
> 	if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { 
> 	    return TCL_OUT_LINE_COMPILE; 
> 	} 
>     }
>     TclEmitPush(TclRegisterLiteral(envPtr, "", 0, /*onHeap*/ 0), envPtr);
>     envPtr->maxStackDepth = 1;
>     return TCL_OK;
> }
> 
> /*
>  *----------------------------------------------------------------------
>  *
Index: generic/tclInt.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.h,v
retrieving revision 1.58
diff -r1.58 tclInt.h
2002a2003,2004
> EXTERN int	Tcl_NopObjCmd _ANSI_ARGS_((ClientData clientData,
> 		    Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
2109a2112,2113
> 		    Tcl_Parse *parsePtr, struct CompileEnv *envPtr));
> EXTERN int	TclCompileNopCmd _ANSI_ARGS_((Tcl_Interp *interp,