summaryrefslogtreecommitdiffstats
path: root/generic/tclCompExpr.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-01-16 21:05:46 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-01-16 21:05:46 (GMT)
commit6101ed5d08da556682f4d6c8870f87180eeef50a (patch)
tree5ccefed6827a363ec7449b2b710f2f55806a4c92 /generic/tclCompExpr.c
parent649a6115420f5c28c50feee55a7e0e441b22188d (diff)
downloadtcl-6101ed5d08da556682f4d6c8870f87180eeef50a.zip
tcl-6101ed5d08da556682f4d6c8870f87180eeef50a.tar.gz
tcl-6101ed5d08da556682f4d6c8870f87180eeef50a.tar.bz2
* generic/tclCompExpr.c: add an 'optimize' argument to
* generic/tclCompile.c: TclCompileExpr() to profit from better * generic/tclCompile.h: literal management according to usage. * generic/tclExecute.c:
Diffstat (limited to 'generic/tclCompExpr.c')
-rw-r--r--generic/tclCompExpr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 22022cf..c3d7532 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompExpr.c,v 1.92 2008/01/16 19:44:13 msofer Exp $
+ * RCS: @(#) $Id: tclCompExpr.c,v 1.93 2008/01/16 21:05:47 msofer Exp $
*/
#include "tclInt.h"
@@ -2000,7 +2000,8 @@ TclCompileExpr(
Tcl_Interp *interp, /* Used for error reporting. */
const char *script, /* The source script to compile. */
int numBytes, /* Number of bytes in script. */
- CompileEnv *envPtr) /* Holds resulting instructions. */
+ CompileEnv *envPtr, /* Holds resulting instructions. */
+ int optimize) /* 0 for one-off expressions */
{
OpNode *opTree = NULL; /* Will point to the tree of operators */
Tcl_Obj *litList = Tcl_NewObj(); /* List to hold the literals */
@@ -2026,7 +2027,7 @@ TclCompileExpr(
TclListObjGetElements(NULL, litList, &objc, (Tcl_Obj ***)&litObjv);
TclListObjGetElements(NULL, funcList, &objc, &funcObjv);
CompileExprTree(interp, opTree, 0, &litObjv, funcObjv,
- parsePtr->tokenPtr, envPtr, 1 /* optimize */);
+ parsePtr->tokenPtr, envPtr, optimize);
} else {
TclCompileSyntaxError(interp, envPtr);
}