summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-05-30 18:12:57 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-05-30 18:12:57 (GMT)
commitc3a6364780e6096f9665ff4b903d52e88abec903 (patch)
tree3556fc80b8c80f1b647b426b8d1dfdf33d4e09e2 /generic/tclBasic.c
parentdd4bd718f68c159cfd56b0a21fb425a8fdf4941a (diff)
downloadtcl-c3a6364780e6096f9665ff4b903d52e88abec903.zip
tcl-c3a6364780e6096f9665ff4b903d52e88abec903.tar.gz
tcl-c3a6364780e6096f9665ff4b903d52e88abec903.tar.bz2
* generic/tclBasic.c: Removed code that dealt with
* generic/tclCompile.c: TCL_TOKEN_EXPAND_WORD tokens representing * generic/tclCompile.h: expanded literal words. These sections were mostly in place to enable [info frame] to discover line information in expanded literals. Since the parser now generates a token for each post-expansion word referring to the right location in the original script string, [info frame] gets all the data it needs. * generic/tclInt.h: Revised the parser so that it never produces * generic/tclParse.c: TCL_TOKEN_EXPAND_WORD tokens when parsing an * tests/parse.test: expanded literal word; that is, something like {*}{x y z}. Instead, generate the series of TCL_TOKEN_SIMPLE_WORD tokens to represent the words that expansion of the literal string produces. [RFE 1725186]
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c48
1 files changed, 4 insertions, 44 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 33f5da7..6471e6f 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.244 2007/04/20 05:51:08 kennykb Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.245 2007/05/30 18:12:57 dgp Exp $
*/
#include "tclInt.h"
@@ -3926,14 +3926,6 @@ TclEvalEx(
CmdFrame eeFrame; /* TIP #280 Structures for tracking of command
* locations. */
- /*
- * TIP #280. The array 'expand' has become tri-valued.
- * 0 = No expansion
- * 1 = Expansion, value is dynamically constructed ($var, [cmd]).
- * 2 = NEW Expansion of a literal value. Here the system determines the
- * actual line numbers within the literal.
- */
-
if (numBytes < 0) {
numBytes = strlen(script);
}
@@ -4074,9 +4066,7 @@ TclEvalEx(
TclAdvanceLines(&wordLine, wordStart, tokenPtr->start);
wordStart = tokenPtr->start;
- lines[objectsUsed] =
- (TclWordKnownAtCompileTime(tokenPtr, NULL)
- || TclWordSimpleExpansion(tokenPtr))
+ lines[objectsUsed] = TclWordKnownAtCompileTime(tokenPtr, NULL)
? wordLine : -1;
if (eeFrame.type == TCL_LOCATION_SOURCE) {
@@ -4109,8 +4099,7 @@ TclEvalEx(
goto error;
}
expandRequested = 1;
- expand[objectsUsed] =
- TclWordSimpleExpansion(tokenPtr) ? 2 : 1;
+ expand[objectsUsed] = 1;
objectsNeeded += (numElements ? numElements : 1);
} else {
@@ -4138,36 +4127,7 @@ TclEvalEx(
objectsUsed = 0;
while (wordIdx--) {
- if (expand[wordIdx] == 2) {
- /*
- * TIP #280. The expansion is for a simple literal.
- * Not only crack the list into its elements,
- * determine the line numbers within it as well.
- *
- * The qualification of 'simple' ensures that the word
- * does not contain backslash-subst, no way to get
- * thrown off by embedded \n sequnces.
- */
-
- int numElements;
- Tcl_Obj **elements, *temp = copy[wordIdx];
- int *eline;
-
- Tcl_ListObjGetElements(NULL, temp, &numElements,
- &elements);
- eline = (int *) ckalloc(numElements * sizeof(int));
- TclListLines(TclGetString(temp),lcopy[wordIdx],
- numElements, eline);
-
- objectsUsed += numElements;
- while (numElements--) {
- lines[objIdx] = eline[numElements];
- objv[objIdx--] = elements[numElements];
- Tcl_IncrRefCount(elements[numElements]);
- }
- Tcl_DecrRefCount(temp);
- ckfree((char *) eline);
- } else if (expand[wordIdx]) {
+ if (expand[wordIdx]) {
int numElements;
Tcl_Obj **elements, *temp = copy[wordIdx];