summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-10-26 08:25:02 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-10-26 08:25:02 (GMT)
commitab8249dfc3c847de69ae379bb7849bdb7346db40 (patch)
tree2c6d109993ecaaac663957806936a709f271c448 /generic/tclCompCmds.c
parentfdfd431637d67d40a0af98bfe92a2771a2852e94 (diff)
downloadtcl-ab8249dfc3c847de69ae379bb7849bdb7346db40.zip
tcl-ab8249dfc3c847de69ae379bb7849bdb7346db40.tar.gz
tcl-ab8249dfc3c847de69ae379bb7849bdb7346db40.tar.bz2
General [concat] compilation.
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c12
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;
}
/*