diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2014-01-22 09:11:07 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2014-01-22 09:11:07 (GMT) |
commit | 3a8a86bb0ac1f0fdacfe168f40f02bd6f2137b35 (patch) | |
tree | 03b33f1323fd08527a41a77d8b05f1cb85346131 /generic/tclCompCmdsSZ.c | |
parent | 440580a4ca2cafdfea33b72268105d19cba4098c (diff) | |
parent | 78a75740ae5c82cc161e49e5e28a306fa9f2a580 (diff) | |
download | tcl-3a8a86bb0ac1f0fdacfe168f40f02bd6f2137b35.zip tcl-3a8a86bb0ac1f0fdacfe168f40f02bd6f2137b35.tar.gz tcl-3a8a86bb0ac1f0fdacfe168f40f02bd6f2137b35.tar.bz2 |
add compilation for [nextto] and [yieldto]; fix [a90d9331bc]
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 c54a06a..4b14f24 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -3447,6 +3447,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. |