diff options
author | dgp <dgp@users.sourceforge.net> | 2013-09-27 16:54:10 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-09-27 16:54:10 (GMT) |
commit | 0e135facf9ea83fb0acc6ea913bc016dc5429c38 (patch) | |
tree | c72ff5e4788cb648a586690a19ebd6dd47008703 | |
parent | 130082d57a8eecf64d27adcb53065841cffae765 (diff) | |
parent | f43e26d84c0342402389b06a5fa4e419a927e541 (diff) | |
download | tcl-0e135facf9ea83fb0acc6ea913bc016dc5429c38.zip tcl-0e135facf9ea83fb0acc6ea913bc016dc5429c38.tar.gz tcl-0e135facf9ea83fb0acc6ea913bc016dc5429c38.tar.bz2 |
Patch to the original line continuation commit to fix up TclCompileTokens.adjust_fix
-rw-r--r-- | generic/tclCompile.c | 6 | ||||
-rw-r--r-- | tests/source.test | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index a0ac9d3..8bb105b 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1687,7 +1687,7 @@ TclCompileTokens( char buffer[TCL_UTF_MAX]; const char *name, *p; int numObjsToConcat, nameBytes, localVarName, localVar; - int length, i; + int length, i, adjust; unsigned char *entryCodeNext = envPtr->codeNext; #define NUM_STATIC_POS 20 int isLiteral, maxNumCL, numCL; @@ -1725,6 +1725,7 @@ TclCompileTokens( clPosition = (int*) ckalloc (maxNumCL*sizeof(int)); } + adjust = 0; Tcl_DStringInit(&textBuffer); numObjsToConcat = 0; for ( ; count > 0; count--, tokenPtr++) { @@ -1765,6 +1766,7 @@ TclCompileTokens( clPosition[numCL] = clPos; numCL ++; } + adjust++; } break; @@ -1789,8 +1791,10 @@ TclCompileTokens( numCL = 0; } + envPtr->line += adjust; TclCompileScript(interp, tokenPtr->start+1, tokenPtr->size-2, envPtr); + envPtr->line -= adjust; numObjsToConcat++; break; diff --git a/tests/source.test b/tests/source.test index f358042..a1419a3 100644 --- a/tests/source.test +++ b/tests/source.test @@ -176,6 +176,16 @@ test source-3.5 {return with special code etc.} -setup { invoked from within "source $sourcefile"} {a b c}} +test source-4.1 {continuation line parsing} -setup { + set sourcefile [makeFile [string map {CL \\\n} { + format %s "[dict get [info frame 0] type]:CL[dict get [info frame 0] line]CL[dict get [info frame 0] line]CL[dict get [info frame 0] line]" + }] source.file] +} -body { + source $sourcefile +} -cleanup { + removeFile source.file +} -result {source: 3 4 5} + test source-6.1 {source is binary ok} -setup { # Note [makeFile] writes in the system encoding. # [source] defaults to reading in the system encoding. @@ -288,4 +298,4 @@ return # Local Variables: # mode: tcl -# End:
\ No newline at end of file +# End: |