diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2013-10-26 08:25:02 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2013-10-26 08:25:02 (GMT) |
commit | 9cc416d585cd447bebe8c27298198f3101b7d6f2 (patch) | |
tree | 2c6d109993ecaaac663957806936a709f271c448 /generic/tclCompCmds.c | |
parent | f663a0f78dfd7409ced97e98402bb3c0419c5d4a (diff) | |
download | tcl-9cc416d585cd447bebe8c27298198f3101b7d6f2.zip tcl-9cc416d585cd447bebe8c27298198f3101b7d6f2.tar.gz tcl-9cc416d585cd447bebe8c27298198f3101b7d6f2.tar.bz2 |
General [concat] compilation.
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r-- | generic/tclCompCmds.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index a1ccd39..2f6cb96 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -779,10 +779,12 @@ TclCompileConcatCmd( * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { + DefineLineInformation; /* TIP #280 */ Tcl_Obj *objPtr, *listObj; Tcl_Token *tokenPtr; int i; + /* TODO: Consider compiling expansion case. */ if (parsePtr->numWords == 1) { /* * [concat] without arguments just pushes an empty object. @@ -827,8 +829,14 @@ TclCompileConcatCmd( * General case: runtime concat. */ - // TODO - return TCL_ERROR; + for (i = 1, tokenPtr = parsePtr->tokenPtr; i < parsePtr->numWords; i++) { + tokenPtr = TokenAfter(tokenPtr); + CompileWord(envPtr, tokenPtr, interp, i); + } + + TclEmitInstInt4( INST_CONCAT_STK, i-1, envPtr); + + return TCL_OK; } /* |