summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-10-08 13:44:37 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-10-08 13:44:37 (GMT)
commitba7edb67f66f3ae93d7c0ba267d77f5fbcf285f4 (patch)
tree11e807013d92abd0901f25d1b5377d6b4276d8a8 /generic/tclParse.c
parent9257d59dfb725123d0783a0584e0af27eb45c998 (diff)
downloadtcl-ba7edb67f66f3ae93d7c0ba267d77f5fbcf285f4.zip
tcl-ba7edb67f66f3ae93d7c0ba267d77f5fbcf285f4.tar.gz
tcl-ba7edb67f66f3ae93d7c0ba267d77f5fbcf285f4.tar.bz2
merge updates from HEAD kennykb_numerics_branch
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index be64878..5464d17 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -12,7 +12,7 @@
* 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.39.2.3 2005/08/02 18:16:04 dgp Exp $
+ * RCS: @(#) $Id: tclParse.c,v 1.39.2.4 2005/10/08 13:44:37 dgp Exp $
*/
#include "tclInt.h"
@@ -374,20 +374,28 @@ Tcl_ParseCommand(interp, start, numBytes, nested, parsePtr)
*/
expPtr = &parsePtr->tokenPtr[expIdx];
- if ((expPfxLen == (size_t) expPtr->size)
- /* Same length as prefix */
- && (0 == expandWord)
- /* Haven't seen prefix already */
- && (1 == parsePtr->numTokens - expIdx)
- /* Only one token */
- && (0 == strncmp(expPfx,expPtr->start,expPfxLen))
- /* Is the prefix */
- && (numBytes > 0)
- && (TclParseWhiteSpace(termPtr, numBytes, parsePtr, &type)
- == 0)
- && (type != TYPE_COMMAND_END)
- /* Non-whitespace follows */
- ) {
+ if (
+ (0 == expandWord)
+ /* Haven't seen prefix already */
+ && (1 == parsePtr->numTokens - expIdx)
+ /* Only one token */
+ && (((expPfxLen == (size_t) expPtr->size)
+ /* Same length as prefix */
+ && (0 == strncmp(expPfx,expPtr->start,expPfxLen)))
+#ifdef ALLOW_EMPTY_EXPAND
+ /*
+ * Allow {} in addition to {expand}
+ */
+ || (0 == (size_t) expPtr->size)
+#endif
+ )
+ /* Is the prefix */
+ && (numBytes > 0)
+ && (TclParseWhiteSpace(termPtr, numBytes, parsePtr,
+ &type) == 0)
+ && (type != TYPE_COMMAND_END)
+ /* Non-whitespace follows */
+ ) {
expandWord = 1;
parsePtr->numTokens--;
goto parseWord;