diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2012-11-01 20:40:55 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2012-11-01 20:40:55 (GMT) |
| commit | f6d9b35b1e1383315af919cd15e94e8dc7fffcda (patch) | |
| tree | c90a2e185468443f2a0436c84d413717c3ea8486 /generic/tclCompCmds.c | |
| parent | d72c1c681d561ca1b22fb51b56d06856c12e8b4e (diff) | |
| download | tcl-f6d9b35b1e1383315af919cd15e94e8dc7fffcda.zip tcl-f6d9b35b1e1383315af919cd15e94e8dc7fffcda.tar.gz tcl-f6d9b35b1e1383315af919cd15e94e8dc7fffcda.tar.bz2 | |
Working towards a BCCed [next].
This version <i>almost</i> works, except for a problem with restoring the
context namespace upon return (which produces very strange results!)
Diffstat (limited to 'generic/tclCompCmds.c')
| -rw-r--r-- | generic/tclCompCmds.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 5beb7bd..96bb9a4 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -5535,6 +5535,35 @@ IndexTailVarIfKnown( return localIndex; } +/* + * Compilations of commands relating to TclOO. + */ + +int +TclCompileObjectNextCmd( + 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 = parsePtr->tokenPtr; + int i; + + if (parsePtr->numWords > 255) { + return TCL_ERROR; + } + + for (i=0 ; i<parsePtr->numWords ; i++) { + CompileWord(envPtr, tokenPtr, interp, i); + tokenPtr = TokenAfter(tokenPtr); + } + TclEmitInstInt1( INST_TCLOO_NEXT, i, envPtr); + return TCL_OK; +} + int TclCompileObjectSelfCmd( Tcl_Interp *interp, /* Used for error reporting. */ |
