diff options
author | dgp <dgp@users.sourceforge.net> | 2013-07-11 04:07:39 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-07-11 04:07:39 (GMT) |
commit | 879263daeede5edbf8536cab6eba690b9a7cad4a (patch) | |
tree | dd314bf04dc89630af6697fd178f26dde3d2cad7 /generic/tclEnsemble.c | |
parent | fceaf9997d7c45ba92c6c61930207823446f1e50 (diff) | |
parent | ac62d0c4970dfe3fa03f4fa77c05d23943a20671 (diff) | |
download | tcl-879263daeede5edbf8536cab6eba690b9a7cad4a.zip tcl-879263daeede5edbf8536cab6eba690b9a7cad4a.tar.gz tcl-879263daeede5edbf8536cab6eba690b9a7cad4a.tar.bz2 |
Add a test for each call to SetLineInformation() demonstrating the need
for it to be there. Fixed bugs revealed by the new tests.
What's still missing are more tests demonstrating the need for other
SetLineInformation() calls that are not there yet. ;)
Diffstat (limited to 'generic/tclEnsemble.c')
-rw-r--r-- | generic/tclEnsemble.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index a718d0e..0bb7cb6 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -88,16 +88,6 @@ const Tcl_ObjType tclEnsembleCmdType = { NULL /* setFromAnyProc */ }; -/* - * Copied from tclCompCmds.c - */ - -#define DefineLineInformation \ - ExtCmdLoc *mapPtr = envPtr->extCmdMapPtr; \ - int eclIndex = mapPtr->nuloc - 1 -#define SetLineInformation(word) \ - envPtr->line = mapPtr->loc[eclIndex].line[(word)]; \ - envPtr->clNext = mapPtr->loc[eclIndex].next[(word)] static inline Tcl_Obj * NewNsObj( @@ -3178,6 +3168,7 @@ CompileToInvokedCommand( bytes = Tcl_GetStringFromObj(words[i-1], &length); PushLiteral(envPtr, bytes, length); } else if (tokPtr->type == TCL_TOKEN_SIMPLE_WORD) { + /* TODO: Check about registering Cmd Literals here */ int literal = TclRegisterNewLiteral(envPtr, tokPtr[1].start, tokPtr[1].size); @@ -3189,9 +3180,7 @@ CompileToInvokedCommand( } TclEmitPush(literal, envPtr); } else { - if (envPtr->clNext) { - SetLineInformation(i); - } + SetLineInformation(i); CompileTokens(envPtr, tokPtr, interp); } tokPtr = TokenAfter(tokPtr); @@ -3265,12 +3254,10 @@ CompileBasicNArgCommand( tokenPtr = TokenAfter(parsePtr->tokenPtr); for (i=1 ; i<parsePtr->numWords ; i++) { - if (envPtr->clNext) { - SetLineInformation(i); - } if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { PushLiteral(envPtr, tokenPtr[1].start, tokenPtr[1].size); } else { + SetLineInformation(i); CompileTokens(envPtr, tokenPtr, interp); } tokenPtr = TokenAfter(tokenPtr); |