diff options
author | dgp <dgp@users.sourceforge.net> | 2013-07-18 15:05:18 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-07-18 15:05:18 (GMT) |
commit | 517197f8571ca5ff1c51b2cadc771505922d9137 (patch) | |
tree | 97de78e38c2f1e7cd5411638a63eaca8ef6f2ab0 /generic/tclAssembly.c | |
parent | a398b126a43e46efa6d6044b0bcf57a4b9385c4e (diff) | |
download | tcl-517197f8571ca5ff1c51b2cadc771505922d9137.zip tcl-517197f8571ca5ff1c51b2cadc771505922d9137.tar.gz tcl-517197f8571ca5ff1c51b2cadc771505922d9137.tar.bz2 |
[Bug 1c17fbba5d] Fix -errorinfo from syntax errors so that the error is
not obscured. Instead highlight it by making it the last character quoted.
Diffstat (limited to 'generic/tclAssembly.c')
-rw-r--r-- | generic/tclAssembly.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 62641e6..416ee10 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -985,8 +985,6 @@ TclAssembleCode( const char* instPtr = codePtr; /* Where to start looking for a line of code */ - int instLen; /* Length in bytes of the current line of - * code */ const char* nextPtr; /* Pointer to the end of the line of code */ int bytesLeft = codeLen; /* Number of bytes of source code remaining to * be parsed */ @@ -1000,10 +998,6 @@ TclAssembleCode( */ status = Tcl_ParseCommand(interp, instPtr, bytesLeft, 0, parsePtr); - instLen = parsePtr->commandSize; - if (parsePtr->term == parsePtr->commandStart + instLen - 1) { - --instLen; - } /* * Report errors in the parse. @@ -1012,7 +1006,7 @@ TclAssembleCode( if (status != TCL_OK) { if (flags & TCL_EVAL_DIRECT) { Tcl_LogCommandInfo(interp, codePtr, parsePtr->commandStart, - instLen); + parsePtr->term + 1 - parsePtr->commandStart); } FreeAssemblyEnv(assemEnvPtr); return TCL_ERROR; @@ -1032,6 +1026,13 @@ TclAssembleCode( */ if (parsePtr->numWords > 0) { + int instLen = parsePtr->commandSize; + /* Length in bytes of the current command */ + + if (parsePtr->term == parsePtr->commandStart + instLen - 1) { + --instLen; + } + /* * If tracing, show each line assembled as it happens. */ |