summaryrefslogtreecommitdiffstats
path: root/generic/tclCompExpr.c
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2008-01-16 21:05:46 (GMT)
committermsofer <msofer@noemail.net>2008-01-16 21:05:46 (GMT)
commit0495ef31c9a98809cc1e3016bbba7daf7621da9a (patch)
tree5ccefed6827a363ec7449b2b710f2f55806a4c92 /generic/tclCompExpr.c
parentb05706f28ee84d3d86f5ce5b0b2463802dbdfb6b (diff)
downloadtcl-0495ef31c9a98809cc1e3016bbba7daf7621da9a.zip
tcl-0495ef31c9a98809cc1e3016bbba7daf7621da9a.tar.gz
tcl-0495ef31c9a98809cc1e3016bbba7daf7621da9a.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: FossilOrigin-Name: 30b91ac5747f01f08e4ee56fc5d79d234bbe664f
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);
}