summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2006-11-03 00:34:51 (GMT)
committerhobbs <hobbs>2006-11-03 00:34:51 (GMT)
commitc399e676c8dbdec3ce1fe4b694d7c269f9b1f675 (patch)
tree13086bc5f8998596d202f1bdeaa9df4ed46bc3cd /generic/tclParse.c
parentee75480f2f9483654c8f665acd984569f3234ca8 (diff)
downloadtcl-c399e676c8dbdec3ce1fe4b694d7c269f9b1f675.zip
tcl-c399e676c8dbdec3ce1fe4b694d7c269f9b1f675.tar.gz
tcl-c399e676c8dbdec3ce1fe4b694d7c269f9b1f675.tar.bz2
* doc/ParseCmd.3, doc/Tcl.n, doc/eval.n, doc/exec.n:
* doc/fconfigure.n, doc/interp.n, doc/unknown.n: * library/auto.tcl, library/init.tcl, library/package.tcl: * library/safe.tcl, library/tm.tcl, library/msgcat/msgcat.tcl: * tests/all.tcl, tests/basic.test, tests/cmdInfo.test: * tests/compile.test, tests/encoding.test, tests/execute.test: * tests/fCmd.test, tests/http.test, tests/init.test: * tests/interp.test, tests/io.test, tests/ioUtil.test: * tests/iogt.test, tests/namespace-old.test, tests/namespace.test: * tests/parse.test, tests/pkg.test, tests/pkgMkIndex.test: * tests/proc.test, tests/reg.test, tests/trace.test: * tests/upvar.test, tests/winConsole.test, tests/winFCmd.test: * tools/tclZIC.tcl: * generic/tclParse.c (Tcl_ParseCommand): Replace {expand} with {*} officially (TIP #293). Leave -DALLOW_EXPAND=0|1 option to keep {expand} syntax for transition users. [Bug 1589629]
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 3574cd3..d8a2655 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -12,12 +12,19 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclParse.c,v 1.47 2006/09/24 19:13:43 msofer Exp $
+ * RCS: @(#) $Id: tclParse.c,v 1.48 2006/11/03 00:34:52 hobbs Exp $
*/
#include "tclInt.h"
/*
+ * For now, we enable the {expand} although it is deprecated - remove by final
+ */
+#ifndef ALLOW_EXPAND
+#define ALLOW_EXPAND 1
+#endif
+
+/*
* The following table provides parsing information about each possible 8-bit
* character. The table is designed to be referenced with either signed or
* unsigned characters, so it has 384 entries. The first 128 entries
@@ -359,8 +366,6 @@ Tcl_ParseCommand(
src = termPtr;
numBytes = parsePtr->end - src;
} else if (*src == '{') {
- static char expPfx[] = "expand";
- CONST size_t expPfxLen = sizeof(expPfx) - 1;
int expIdx = wordIndex + 1;
Tcl_Token *expPtr;
@@ -372,7 +377,7 @@ Tcl_ParseCommand(
numBytes = parsePtr->end - src;
/*
- * Check whether the braces contained the word expansion prefix.
+ * Check whether the braces contained the word expansion prefix {*}
*/
expPtr = &parsePtr->tokenPtr[expIdx];
@@ -381,14 +386,15 @@ Tcl_ParseCommand(
/* Haven't seen prefix already */
&& (1 == parsePtr->numTokens - expIdx)
/* Only one token */
- && (((expPfxLen == (size_t) expPtr->size)
+ && (((1 == (size_t) expPtr->size)
/* Same length as prefix */
- && (0 == strncmp(expPfx,expPtr->start,expPfxLen)))
-#ifdef ALLOW_EMPTY_EXPAND
+ && (expPtr->start[0] == '*'))
+#if defined(ALLOW_EXPAND) && ALLOW_EXPAND == 1
/*
- * Allow {} in addition to {expand}
+ * Allow {expand} in addition to {*}
*/
- || (0 == (size_t) expPtr->size)
+ || ((6 == (size_t) expPtr->size)
+ && (0 == memcmp("expand",expPtr->start,6)))
#endif
)
/* Is the prefix */