diff options
author | dgp <dgp@users.sourceforge.net> | 2009-09-17 17:58:09 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2009-09-17 17:58:09 (GMT) |
commit | 76a7b7436a2b6d136bd796fbc2dd53cd3f4385dc (patch) | |
tree | c8705818cc28b4867edbb3dd5e99ea4b1f2ae264 /generic/tclCompile.c | |
parent | cfef008bffcfc7b272e5fd62ff6f62f333e0c4d3 (diff) | |
download | tcl-76a7b7436a2b6d136bd796fbc2dd53cd3f4385dc.zip tcl-76a7b7436a2b6d136bd796fbc2dd53cd3f4385dc.tar.gz tcl-76a7b7436a2b6d136bd796fbc2dd53cd3f4385dc.tar.bz2 |
* generic/tclCompile.c: Re-implement Tcl_SubstObj() as a simple
* generic/tclParse.c: wrapper around TclNRSubstObj(). This has
* tests/basic.test: the effect of caching compiled bytecode in
* tests/parse.test: the value to be substituted. Note that
Tcl_SubstObj() now exists only for extensions. Tcl itself no longer
makes any use of it. Note also that TclSubstTokens() is now reachable
only by Tcl_EvalEx() and Tcl_ParseVar() so tests aiming to test its
functioning needed adjustment to still have the intended effect.
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r-- | generic/tclCompile.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 9fa8f6a..36e24d2 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.c,v 1.175 2009/09/12 06:43:12 das Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.176 2009/09/17 17:58:10 dgp Exp $ */ #include "tclInt.h" @@ -875,6 +875,37 @@ TclCleanupByteCode( /* *---------------------------------------------------------------------- * + * Tcl_SubstObj -- + * + * This function performs the substitutions specified on the given string + * as described in the user documentation for the "subst" Tcl command. + * + * Results: + * A Tcl_Obj* containing the substituted string, or NULL to indicate that + * an error occurred. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +Tcl_Obj * +Tcl_SubstObj( + Tcl_Interp *interp, /* Interpreter in which substitution occurs */ + Tcl_Obj *objPtr, /* The value to be substituted. */ + int flags) /* What substitutions to do. */ +{ + if (TclNRRunCallbacks(interp, TclNRSubstObj(interp, objPtr, flags), + TOP_CB(interp), 0) != TCL_OK) { + return NULL; + } + return Tcl_GetObjResult(interp); +} + +/* + *---------------------------------------------------------------------- + * * TclNRSubstObj -- * * Request substitution of a Tcl value by the NR stack. |