diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2014-01-25 09:02:30 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2014-01-25 09:02:30 (GMT) |
commit | 18cc046d76f822340ac711ab379965ea61cae9b3 (patch) | |
tree | 6850ff329261da488e14891e203120b8b8bc9a15 /generic/tclCompCmdsSZ.c | |
parent | aa2c40934df3fdefbb39338f7eef44e79c3c551e (diff) | |
parent | 6e072443704a589149fea001df51f9870b78c323 (diff) | |
download | tcl-18cc046d76f822340ac711ab379965ea61cae9b3.zip tcl-18cc046d76f822340ac711ab379965ea61cae9b3.tar.gz tcl-18cc046d76f822340ac711ab379965ea61cae9b3.tar.bz2 |
merge principal development branch
Diffstat (limited to 'generic/tclCompCmdsSZ.c')
-rw-r--r-- | generic/tclCompCmdsSZ.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 91bb94c..1a69a89 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -3679,6 +3679,51 @@ TclCompileYieldCmd( /* *---------------------------------------------------------------------- * + * TclCompileYieldToCmd -- + * + * Procedure called to compile the "yieldto" command. + * + * Results: + * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer + * evaluation to runtime. + * + * Side effects: + * Instructions are added to envPtr to execute the "yieldto" command at + * runtime. + * + *---------------------------------------------------------------------- + */ + +int +TclCompileYieldToCmd( + Tcl_Interp *interp, /* Used for error reporting. */ + Tcl_Parse *parsePtr, /* Points to a parse structure for the command + * created by Tcl_ParseCommand. */ + Command *cmdPtr, /* Points to defintion of command being + * compiled. */ + CompileEnv *envPtr) /* Holds resulting instructions. */ +{ + DefineLineInformation; /* TIP #280 */ + Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); + int i; + + if (parsePtr->numWords < 2) { + return TCL_ERROR; + } + + OP( NS_CURRENT); + for (i = 1 ; i < parsePtr->numWords ; i++) { + CompileWord(envPtr, tokenPtr, interp, i); + tokenPtr = TokenAfter(tokenPtr); + } + OP4( LIST, i); + OP( YIELD_TO_INVOKE); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * * CompileUnaryOpCmd -- * * Utility routine to compile the unary operator commands. |